@PublicEvolving public class AbstractID extends Object implements Comparable<AbstractID>, Serializable
Modifier and Type | Field and Description |
---|---|
protected long |
lowerPart
The lower part of the actual ID.
|
static int |
SIZE
The size of the ID in byte.
|
protected long |
upperPart
The upper part of the actual ID.
|
Constructor and Description |
---|
AbstractID()
Constructs a new random ID from a uniform distribution.
|
AbstractID(AbstractID id)
Copy constructor: Creates a new abstract ID from the given one.
|
AbstractID(byte[] bytes)
Constructs a new ID with a specific bytes value.
|
AbstractID(long lowerPart,
long upperPart)
Constructs a new abstract ID.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(AbstractID o) |
boolean |
equals(Object obj) |
byte[] |
getBytes()
Gets the bytes underlying this ID.
|
long |
getLowerPart()
Gets the lower 64 bits of the ID.
|
long |
getUpperPart()
Gets the upper 64 bits of the ID.
|
int |
hashCode() |
String |
toHexString()
Returns pure String representation of the ID in hexadecimal.
|
String |
toString() |
public static final int SIZE
protected final long upperPart
protected final long lowerPart
public AbstractID(byte[] bytes)
public AbstractID(long lowerPart, long upperPart)
lowerPart
- the lower bytes of the IDupperPart
- the higher bytes of the IDpublic AbstractID(AbstractID id)
id
- the abstract ID to copypublic AbstractID()
public long getLowerPart()
public long getUpperPart()
public byte[] getBytes()
public final String toHexString()
public int compareTo(AbstractID o)
compareTo
in interface Comparable<AbstractID>
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.