From 3cbadd37bcb676ed559a031923c9e548329365c4 Mon Sep 17 00:00:00 2001 From: Joe Kiniry Date: Mon, 14 Aug 2017 08:52:57 -0400 Subject: [PATCH] Example implementation of exampleInstance() per message to Dan. --- .../src/main/java/us/freeandfair/corla/model/Elector.java | 5 +++++ .../us/freeandfair/corla/persistence/AbstractEntity.java | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/server/eclipse-project/src/main/java/us/freeandfair/corla/model/Elector.java b/server/eclipse-project/src/main/java/us/freeandfair/corla/model/Elector.java index 87a9dbfc9..d728c188c 100644 --- a/server/eclipse-project/src/main/java/us/freeandfair/corla/model/Elector.java +++ b/server/eclipse-project/src/main/java/us/freeandfair/corla/model/Elector.java @@ -137,4 +137,9 @@ public boolean equals(final Object the_other) { public int hashCode() { return toString().hashCode(); } + + @Override + protected Elector exampleInstance() { + return new Elector("John", "Doe", "Free and Fair Party"); + } } diff --git a/server/eclipse-project/src/main/java/us/freeandfair/corla/persistence/AbstractEntity.java b/server/eclipse-project/src/main/java/us/freeandfair/corla/persistence/AbstractEntity.java index 773fbf8ac..a90a5242e 100644 --- a/server/eclipse-project/src/main/java/us/freeandfair/corla/persistence/AbstractEntity.java +++ b/server/eclipse-project/src/main/java/us/freeandfair/corla/persistence/AbstractEntity.java @@ -43,6 +43,11 @@ protected AbstractEntity() { // default values } + /** + * An example instance of this entity. + */ + protected abstract AbstractEntity exampleInstance(); + /** * {@inheritDoc} */