java/sql-dk/src/main/java/info/globalcode/sql/dk/configuration/Property.java
author František Kučera <franta-hg@frantovo.cz>
Mon, 04 Mar 2019 20:15:24 +0100
branchv_0
changeset 238 4a1864c3e867
parent 105 java/sql-dk/src/info/globalcode/sql/dk/configuration/Property.java@39d8b427e20f
child 250 aae5009bd0af
permissions -rw-r--r--
mavenized: sql-dk
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
104
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     1
/**
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     2
 * SQL-DK
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     3
 * Copyright © 2013 František Kučera (frantovo.cz)
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     4
 *
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     5
 * This program is free software: you can redistribute it and/or modify
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License as published by
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     7
 * the Free Software Foundation, either version 3 of the License, or
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     8
 * (at your option) any later version.
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     9
 *
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    10
 * This program is distributed in the hope that it will be useful,
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    13
 * GNU General Public License for more details.
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    14
 *
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    16
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    17
 */
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    18
package info.globalcode.sql.dk.configuration;
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    19
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    20
import javax.xml.bind.annotation.XmlAttribute;
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    21
import javax.xml.bind.annotation.XmlValue;
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    22
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    23
/**
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    24
 * One configurable
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    25
 *
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    26
 * @author Ing. František Kučera (frantovo.cz)
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    27
 */
105
39d8b427e20f cloneable property and properties
František Kučera <franta-hg@frantovo.cz>
parents: 104
diff changeset
    28
public class Property implements NameIdentified, Cloneable {
104
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    29
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    30
	private String name;
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    31
	private String value;
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    32
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    33
	public Property() {
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    34
	}
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    35
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    36
	public Property(String name, String value) {
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    37
		this.name = name;
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    38
		this.value = value;
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    39
	}
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    40
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    41
	@XmlAttribute(name = "name")
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    42
	@Override
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    43
	public String getName() {
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    44
		return name;
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    45
	}
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    46
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    47
	public void setName(String name) {
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    48
		this.name = name;
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    49
	}
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    50
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    51
	@XmlValue
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    52
	public String getValue() {
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    53
		return value;
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    54
	}
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    55
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    56
	public void setValue(String value) {
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    57
		this.value = value;
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    58
	}
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    59
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    60
	@Override
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    61
	public String toString() {
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    62
		return name + "='" + value + "'";
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    63
	}
105
39d8b427e20f cloneable property and properties
František Kučera <franta-hg@frantovo.cz>
parents: 104
diff changeset
    64
39d8b427e20f cloneable property and properties
František Kučera <franta-hg@frantovo.cz>
parents: 104
diff changeset
    65
	@Override
39d8b427e20f cloneable property and properties
František Kučera <franta-hg@frantovo.cz>
parents: 104
diff changeset
    66
	protected Property clone() {
39d8b427e20f cloneable property and properties
František Kučera <franta-hg@frantovo.cz>
parents: 104
diff changeset
    67
		return new Property(name, value);
39d8b427e20f cloneable property and properties
František Kučera <franta-hg@frantovo.cz>
parents: 104
diff changeset
    68
	}
104
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    69
}