HSBType extends PercentType implements ComplexType, State, Command { @Override public boolean equals(@Nullable Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof HSBType)) { return false; } HSBType other = (HSBType) obj; if (!getHue().equals(other.getHue()) || !getSaturation().equals(other.getSaturation()) || !getBrightness().equals(other.getBrightness())) { return false; } return true; } HSBType();  HSBType(DecimalType h, PercentType s, PercentType b);  HSBType(String value); static HSBType valueOf(String value); static HSBType fromRGB(int r, int g, int b); static HSBType fromXY(float x, float y); @Override SortedMap<String, PrimitiveType> getConstituents(); DecimalType getHue(); PercentType getSaturation(); PercentType getBrightness(); PercentType getRed(); PercentType getGreen(); PercentType getBlue(); int getRGB(); @Override String toString(); @Override String toFullString(); @Override int hashCode(); @Override boolean equals(@Nullable Object obj); PercentType[] toRGB(); PercentType[] toXY(); @Override T as(@Nullable Class<T> target); static final String KEY_HUE; static final String KEY_SATURATION; static final String KEY_BRIGHTNESS; static final HSBType BLACK; static final HSBType WHITE; static final HSBType RED; static final HSBType GREEN; static final HSBType BLUE; }
@Test public void testEquals() { HSBType hsb1 = new HSBType("53,86,1"); HSBType hsb2 = new HSBType("53,86,1"); assertTrue(hsb1.equals(hsb2)); hsb1 = new HSBType("0,0,0"); hsb2 = new HSBType("0,0,0"); assertTrue(hsb1.equals(hsb2)); }