Package io.atomix.utils
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 Tidentifier
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractIdentifier()Constructor for serialization.protectedAbstractIdentifier(T value)Constructs an identifier backed by the specified value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)Compares two device key identifiers for equality.inthashCode()Returns the hashcode of the identifier.Tid()Returns the backing identifier value.StringtoString()Returns a string representation of a DeviceKeyId.
-
-
-
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:
idin interfaceIdentifier<T extends Comparable<T>>- Returns:
- identifier
-
hashCode
public int hashCode()
Returns the hashcode of the identifier.
-
equals
public boolean equals(Object obj)
Compares two device key identifiers for equality.
-
-