diff options
Diffstat (limited to 'src/main/java/io/trygvis/esper/testing/AbstractEntity.java')
-rw-r--r-- | src/main/java/io/trygvis/esper/testing/AbstractEntity.java | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/main/java/io/trygvis/esper/testing/AbstractEntity.java b/src/main/java/io/trygvis/esper/testing/AbstractEntity.java new file mode 100644 index 0000000..927a223 --- /dev/null +++ b/src/main/java/io/trygvis/esper/testing/AbstractEntity.java @@ -0,0 +1,28 @@ +package io.trygvis.esper.testing; + +import org.joda.time.*; + +import java.util.*; + +public abstract class AbstractEntity { + public final UUID uuid; + public final DateTime createdDate; + + protected AbstractEntity(UUID uuid, DateTime createdDate) { + this.uuid = uuid; + this.createdDate = createdDate; + } + + public boolean equals(Object o) { + if (this == o) return true; + if (!(o instanceof AbstractEntity)) return false; + + AbstractEntity that = (AbstractEntity) o; + + return uuid.equals(that.uuid); + } + + public int hashCode() { + return uuid.hashCode(); + } +} |