return (value == that.value);
}
+ /**
+ * Hashcode uses all fields in equals().
+ *
+ * @return the hash
+ */
+ @Override
+ public int hashCode() {
+ return value;
+ }
+
/**
* Make human-readable description of this Color.
*
return "blue";
case SGRYELLOW:
return "yellow";
+ default:
+ throw new IllegalArgumentException("Invalid Color value: " + value);
}
- throw new IllegalArgumentException("Invalid Color value: " + value);
}
}