diff options
| author | Benjamin Culkin <scorpress@gmail.com> | 2024-07-08 17:30:58 -0400 |
|---|---|---|
| committer | Benjamin Culkin <scorpress@gmail.com> | 2024-07-08 17:30:58 -0400 |
| commit | 9c681f38b742b26b841eb42bc19879cb90ac03de (patch) | |
| tree | 6c1b9eb1971629cc3c42bae3bff9fd930d4af11c /projects/net.wotonomy.datastore/src/main/java/net | |
| parent | 6d46c473d41c6c47e6b8bd8c676d925e544bd378 (diff) | |
Add XML property lists
Implement support for the XML property lists that are the newer version
of the ASCII ones. There are a few things that still need to be done,
but all of the basics are there
Next things
- Allow collapsing a property list into a series of objects
- Serialize both the property list and flattened objects to XML
Diffstat (limited to 'projects/net.wotonomy.datastore/src/main/java/net')
| -rw-r--r-- | projects/net.wotonomy.datastore/src/main/java/net/wotonomy/datastore/DataKey.java | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/projects/net.wotonomy.datastore/src/main/java/net/wotonomy/datastore/DataKey.java b/projects/net.wotonomy.datastore/src/main/java/net/wotonomy/datastore/DataKey.java index 4ac8b50..100800f 100644 --- a/projects/net.wotonomy.datastore/src/main/java/net/wotonomy/datastore/DataKey.java +++ b/projects/net.wotonomy.datastore/src/main/java/net/wotonomy/datastore/DataKey.java @@ -22,13 +22,17 @@ import java.io.Serializable; import net.wotonomy.foundation.internal.ValueConverter; -public class DataKey implements Comparable, Serializable, Cloneable { +/** + * Represents an abstract key for a piece of data + * + */ +public class DataKey implements Comparable<Object>, Serializable, Cloneable { static final long serialVersionUID = 8421127539579065705L; Long key; public DataKey() { - key = new Long(0); + key = 0L; } /** @@ -39,18 +43,21 @@ public class DataKey implements Comparable, Serializable, Cloneable { setKeyString(aString); } + @Override public int hashCode() { return key.intValue(); } public void increment() { - key = new Long(key.longValue() + 1); + key = Long.valueOf(key.longValue() + 1); } + @Override public Object clone() { return new DataKey(this.toString()); } + @Override public String toString() { return key.toString(); } @@ -65,6 +72,7 @@ public class DataKey implements Comparable, Serializable, Cloneable { key = parsed; } + @Override public boolean equals(Object anObject) { if (anObject instanceof String) { if (toString().equals(anObject)) { @@ -76,6 +84,7 @@ public class DataKey implements Comparable, Serializable, Cloneable { return key.equals(((DataKey) anObject).key); } + @Override public int compareTo(Object anObject) { if (anObject instanceof String) { if (toString().equals(anObject)) { |
