From 9c681f38b742b26b841eb42bc19879cb90ac03de Mon Sep 17 00:00:00 2001 From: Benjamin Culkin Date: Mon, 8 Jul 2024 17:30:58 -0400 Subject: 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 --- .../src/main/java/net/wotonomy/datastore/DataKey.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'projects/net.wotonomy.datastore/src/main/java/net/wotonomy/datastore') 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, 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)) { -- cgit v1.2.3