Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

hashCode implementation for Parameter class.

An existing implementation of Parameter.equals exist without
having an implementation of hashCode(), this violate the requirement
that equal must have an equal hashcodes.
  • Loading branch information...
commit bfaeedcf18e24ec1e189eca61e50097afefa22f6 1 parent 43cc235
Asaf Shakarchi asaf authored
9 blueprints-core/src/main/java/com/tinkerpop/blueprints/Parameter.java
View
@@ -53,6 +53,15 @@ public boolean equals(Object object) {
}
return false;
}
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((key == null) ? 0 : key.hashCode());
+ result = prime * result + ((value == null) ? 0 : value.hashCode());
+ return result;
+ }
public String toString() {
return "parameter[" + key + "," + value + "]";
Please sign in to comment.
Something went wrong with that request. Please try again.