Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ianj-als/omtc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Johnson <ian.johnson@appliedlanguage.com>2013-02-21 21:08:54 +0400
committerIan Johnson <ian.johnson@appliedlanguage.com>2013-02-21 21:08:54 +0400
commit524ab97bcfd0bf06d3ba41523ad197b188f2d3c1 (patch)
treec872cca9014913c87942f35f367da3470cb8cacb
parent4631e2a8ff7413d252052c604bea8e12d8302524 (diff)
Ticket equals() and hashCode() implementations added.
-rw-r--r--src/main/java/com/capitati/omtc/core/scheduling/Ticket.java27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/main/java/com/capitati/omtc/core/scheduling/Ticket.java b/src/main/java/com/capitati/omtc/core/scheduling/Ticket.java
index 0bd7114..5aaa977 100644
--- a/src/main/java/com/capitati/omtc/core/scheduling/Ticket.java
+++ b/src/main/java/com/capitati/omtc/core/scheduling/Ticket.java
@@ -63,4 +63,31 @@ public abstract class Ticket<V> {
public V getPriority() {
return priority;
}
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result
+ + ((identifier == null) ? 0 : identifier.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(final Object obj) {
+ if(this == obj)
+ return true;
+ if(obj == null)
+ return false;
+ if(getClass() != obj.getClass())
+ return false;
+ @SuppressWarnings("unchecked")
+ Ticket<V> other = (Ticket<V> )obj;
+ if(identifier == null) {
+ if(other.identifier != null)
+ return false;
+ } else if(!identifier.equals(other.identifier))
+ return false;
+ return true;
+ }
}