Package org.apache.accumulo.core.data
Class AbstractId<T extends AbstractId<T>>
- java.lang.Object
-
- org.apache.accumulo.core.data.AbstractId<T>
-
- All Implemented Interfaces:
Serializable
,Comparable<T>
- Direct Known Subclasses:
CompactionExecutorId
,CompactionServiceId
,ExternalCompactionId
,InstanceId
,NamespaceId
,TableId
public abstract class AbstractId<T extends AbstractId<T>> extends Object implements Comparable<T>, Serializable
An abstract identifier class for comparing equality of identifiers of the same type.- Since:
- 2.0.0
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractId(String canonical)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
canonical()
The canonical ID.int
compareTo(T other)
boolean
equals(Object obj)
AbstractID objects are considered equal if, and only if, they are of the same type and have the same canonical identifier.int
hashCode()
String
toString()
Returns a string of the canonical ID.
-
-
-
Constructor Detail
-
AbstractId
protected AbstractId(String canonical)
-
-
Method Detail
-
canonical
public final String canonical()
The canonical ID. This is guaranteed to be non-null.
-
equals
public boolean equals(Object obj)
AbstractID objects are considered equal if, and only if, they are of the same type and have the same canonical identifier.
-
toString
public final String toString()
Returns a string of the canonical ID. This is guaranteed to be non-null.
-
compareTo
public int compareTo(T other)
- Specified by:
compareTo
in interfaceComparable<T extends AbstractId<T>>
-
-