public class ConditionalInterface {
public final String interfaceName;
public final String hbConditionLabel;
-
+
public ConditionalInterface(String interfaceName, String hbConditionLabel) {
this.interfaceName = interfaceName;
this.hbConditionLabel = hbConditionLabel;
}
-
- public boolean equals(ConditionalInterface other) {
+
+ public boolean equals(Object other) {
if (!(other instanceof ConditionalInterface))
return false;
ConditionalInterface another = (ConditionalInterface) other;
- return another.interfaceName.equals(interfaceName) &&
- another.hbConditionLabel.equals(hbConditionLabel);
+ return another.interfaceName.equals(interfaceName)
+ && (another.hbConditionLabel.equals(hbConditionLabel) || another.hbConditionLabel
+ .equals(""));
}
-
+
public int hashCode() {
return interfaceName.hashCode() << 5 ^ hbConditionLabel.hashCode();
}
-
+
public String toString() {
if (hbConditionLabel.equals(""))
return interfaceName + "(true)";