--- a/java/sql-dk/src/info/globalcode/sql/dk/configuration/Properties.java Tue Dec 31 17:35:33 2013 +0100
+++ b/java/sql-dk/src/info/globalcode/sql/dk/configuration/Properties.java Tue Dec 31 18:11:50 2013 +0100
@@ -20,6 +20,7 @@
import java.util.ArrayList;
import javax.xml.bind.annotation.XmlTransient;
import static info.globalcode.sql.dk.Functions.findByName;
+import java.util.Collections;
/**
* <p>List of configurables.</p>
@@ -38,10 +39,17 @@
*
* @author Ing. František Kučera (frantovo.cz)
*/
-public class Properties extends ArrayList<Property> {
+public class Properties extends ArrayList<Property> implements Cloneable {
private Properties defaults;
+ public Properties() {
+ }
+
+ public Properties(int initialCapacity) {
+ super(initialCapacity);
+ }
+
@XmlTransient
public Properties getDefaults() {
return defaults;
@@ -73,4 +81,11 @@
Property p = findProperty(name);
return p == null ? defaultValue : Integer.valueOf(p.getValue());
}
+
+ @Override
+ public Properties clone() {
+ Properties clone = new Properties(size());
+ Collections.copy(clone, this);
+ return clone;
+ }
}
--- a/java/sql-dk/src/info/globalcode/sql/dk/configuration/Property.java Tue Dec 31 17:35:33 2013 +0100
+++ b/java/sql-dk/src/info/globalcode/sql/dk/configuration/Property.java Tue Dec 31 18:11:50 2013 +0100
@@ -25,7 +25,7 @@
*
* @author Ing. František Kučera (frantovo.cz)
*/
-public class Property implements NameIdentified {
+public class Property implements NameIdentified, Cloneable {
private String name;
private String value;
@@ -61,4 +61,9 @@
public String toString() {
return name + "='" + value + "'";
}
+
+ @Override
+ protected Property clone() {
+ return new Property(name, value);
+ }
}