int result = 1;
result = (prime * result) + ((entry == null) ? 0 : entry.hashCode());
result = (prime * result) + ((requestorController == null) ? 0 : requestorController.hashCode());
- result = (prime * result) + ((upType == null) ? 0 : upType.hashCode());
+ result = (prime * result) + ((upType == null) ? 0 : upType.calculateConsistentHashCode());
return result;
}
public int hashCode() {
final int prime = 31;
int result = 1;
- result = prime * result + ((type == null) ? 0 : type.hashCode());
+ result = prime * result + ((type == null) ? 0 : type.calculateConsistentHashCode());
return result;
}
return true;
}
}
-}
\ No newline at end of file
+
+ public int calculateConsistentHashCode() {
+ if (this.id != null) {
+ return this.id.hashCode();
+ } else {
+ return 0;
+ }
+ }
+}
public String getName() {
return this.name;
}
+
+ public int calculateConsistentHashCode() {
+ if (this.name != null) {
+ return this.name.hashCode();
+ } else {
+ return 0;
+ }
+ }
}
public int hashCode() {
final int prime = 31;
int result = 1;
- result = prime * result + ((fields == null) ? 0 : fields.hashCode());
+ if (this.fields == null) {
+ result = prime * result;
+ } else {
+ int sum = 0;
+ for (MatchType field : this.fields.keySet()) {
+ MatchField f = this.fields.get(field);
+ sum = sum + ((field==null ? 0 : field.calculateConsistentHashCode()) ^
+ (f==null ? 0 : f.hashCode()));
+ }
+ result = prime * result + sum;
+ }
result = prime * result + matches;
return result;
}
public int hashCode(Object v, Object m) {
final int prime = 31;
int result = 1;
- result = prime * result + this.hashCode();
+ result = prime * result + this.calculateConsistentHashCode();
switch (this) {
case DL_SRC:
return (this.equalValues(value1, value2) && this.equalMasks(mask1, mask2));
}
}
+
+ public int calculateConsistentHashCode() {
+ if (this.id != null) {
+ return this.id.hashCode();
+ } else {
+ return 0;
+ }
+ }
}
public int hashCode() {
final int prime = 31;
int result = 1;
- result = prime * result + ((code == null) ? 0 : code.hashCode());
+ result = prime * result + ((code == null) ? 0 : code.calculateConsistentHashCode());
return result;
}
/**
* Prints the description associated to the code value
*/
+ @Override
public String toString() {
return description;
}
+ public int calculateConsistentHashCode() {
+ if (this.description != null) {
+ return this.description.hashCode();
+ } else {
+ return 0;
+ }
+ }
}