Class AbstractIdentifier<T extends Comparable<T>>

java.lang.Object
io.atomix.utils.AbstractIdentifier<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 Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final T
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Constructor for serialization.
    protected
    Constructs an identifier backed by the specified value.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Compares two device key identifiers for equality.
    int
    Returns the hashcode of the identifier.
    id()
    Returns the backing identifier value.
    Returns a string representation of a DeviceKeyId.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • identifier

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

    • 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 Details

    • 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