Class AbstractIdentifier<T extends Comparable<T>>

  • All Implemented Interfaces:
    Identifier<T>

    public class AbstractIdentifier<T extends Comparable<T>>
    extends Object
    implements Identifier<T>
    Abstract identifier backed by another value, e.g. string, int.
    • Field Detail

      • identifier

        protected final T extends Comparable<T> identifier
    • Constructor Detail

      • AbstractIdentifier

        protected AbstractIdentifier()
        Constructor for serialization.
      • AbstractIdentifier

        protected AbstractIdentifier​(T value)
        Constructs an identifier backed by the specified value.
        Parameters:
        value - the backing value
    • Method Detail

      • id

        public T id()
        Returns the backing identifier value.
        Specified by:
        id in interface Identifier<T extends Comparable<T>>
        Returns:
        identifier
      • hashCode

        public int hashCode()
        Returns the hashcode of the identifier.
        Overrides:
        hashCode in class Object
        Returns:
        hashcode
      • equals

        public boolean equals​(Object obj)
        Compares two device key identifiers for equality.
        Overrides:
        equals in class Object
        Parameters:
        obj - to compare against
        Returns:
        true if the objects are equal, false otherwise.
      • toString

        public String toString()
        Returns a string representation of a DeviceKeyId.
        Overrides:
        toString in class Object
        Returns:
        string