Class Key<T>

  • All Implemented Interfaces:
    IKey<T>

    public class Key<T>
    extends Object
    implements IKey<T>
    Default IKey implementation
    Author:
    Michael Haitz
    • Constructor Detail

      • Key

        public Key​(String name,
                   T defaultValue)
        Construct.
        Parameters:
        name - string representation of this key
        defaultValue - The default value
      • Key

        public Key​(String name)
        Construct. Uses `null` as default value
        Parameters:
        name - string representation of this key
    • Method Detail

      • key

        public String key()
        Specified by:
        key in interface IKey<T>
        Returns:
        the key to use in Map
      • isDefaultValue

        public boolean isDefaultValue​(T value)
        Description copied from interface: IKey
        checks if given value is equal to default value
        Specified by:
        isDefaultValue in interface IKey<T>
        Parameters:
        value - The value to check.
        Returns:
        true, if given value is equal to default value
      • getDefaultValue

        public T getDefaultValue()
        Specified by:
        getDefaultValue in interface IKey<T>
        Returns:
        the default value