Added more specific Option comparisons.
@@ -185,6 +185,20 @@ public class Option implements Comparable<Option> {
return this.name().compareTo(other.name());
}
+ @Override
+ public boolean equals(Object other) {
+ if (other == null || other.getClass() != this.getClass()) {
+ return false;
+ }
+
+ return this.name.equals(((Option)other).name);
+ }
+
+ @Override
+ public int hashCode() {
+ return name.hashCode();
+ }
+
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
