X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2Fbits%2FColor.java;h=54ae66aeaf0d54fac263e1e3445bfa47dc50ef9c;hb=e826b451baf0d1e66d09ce03a6fefee2eb8386f5;hp=707b244b12664aa04a2c691cb73cfa3973d06e27;hpb=2b9c27db318b916730aa04f2b41bd3bff795a5dc;p=fanfix.git diff --git a/src/jexer/bits/Color.java b/src/jexer/bits/Color.java index 707b244..54ae66a 100644 --- a/src/jexer/bits/Color.java +++ b/src/jexer/bits/Color.java @@ -215,6 +215,16 @@ public final class Color { 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. * @@ -239,8 +249,9 @@ public final class Color { return "blue"; case SGRYELLOW: return "yellow"; + default: + throw new IllegalArgumentException("Invalid Color value: " + value); } - throw new IllegalArgumentException("Invalid Color value: " + value); } }