|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.xlattice.NodeID
public class NodeID
Quasi-unique 160-bit value serving as a global identifier. This will most often be an SHA-1 digest, but there is no guarantee that it will be. Any value assigned must have the same or similar levels of randomness.
Field Summary | |
---|---|
static int |
LENGTH
length of the node ID in bytes |
Constructor Summary | |
---|---|
NodeID(byte[] b)
Create the node ID from a byte array. |
|
NodeID(java.lang.String val)
Create the node ID from a base-64 encoded value. |
Method Summary | |
---|---|
java.lang.Object |
clone()
|
int |
compareTo(java.lang.Object o)
|
boolean |
equals(java.lang.Object o)
|
int |
hashCode()
|
static boolean |
isValid(byte[] b)
Whether the array reference is non-null and the array of the right length. |
java.lang.String |
toString()
|
byte[] |
value()
Return a reference to the byte array. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int LENGTH
Constructor Detail |
---|
public NodeID(byte[] b)
b
- the value to be assigned to the NodeID
java.lang.IllegalArgumentException
- if the array is not a valid IDpublic NodeID(java.lang.String val)
Method Detail |
---|
public java.lang.Object clone()
clone
in class java.lang.Object
public static final boolean isValid(byte[] b)
public final byte[] value()
public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
public final boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public final int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |