summaryrefslogtreecommitdiff
path: root/projects/net.wotonomy.datastore/src
diff options
context:
space:
mode:
Diffstat (limited to 'projects/net.wotonomy.datastore/src')
-rw-r--r--projects/net.wotonomy.datastore/src/main/java/net/wotonomy/datastore/DataKey.java15
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)) {