Interface IColorField<T extends Serializable>

    • Method Detail

      • equals

        boolean equals​(Object obj)
        Implementations MUST make the comparison only with respect to getIdentifier().
        Overrides:
        equals in class Object
        Parameters:
        obj - Other object to compare this object to.
        Returns:
        Whether this object equals the given object.
      • get

        default T get​(IGuiColor color,
                      T defaultValue)
        Gets the value of this field from the given color. The default implementation simply defers to IGuiColor.getField(IColorField). Sub classes may implement logic, such as computing the value from another field.
        Parameters:
        color - Color from which to get the value.
        defaultValue - Value to return when this field is not supported by the given color.
        Returns:
        The value of this field.
      • getIdentifier

        String getIdentifier()
        Returns:
        Unique identifier of this color field.
      • hashCode

        int hashCode()
        Implementations MUST calculate the hash code only from the getIdentifier().
        Overrides:
        hashCode in class Object
        Returns:
        The hash code of this object.
      • supportedBy

        default boolean supportedBy​(IGuiColor color)
        If a sub class overrides get(IGuiColor), they should also override this method.
        Parameters:
        color - A color to check.
        Returns:
        Whether this field supports getting values of the given color.