Package org.apache.catalina.tribes
Class UniqueId
- java.lang.Object
-
- org.apache.catalina.tribes.UniqueId
-
- All Implemented Interfaces:
java.io.Serializable
public final class UniqueId extends java.lang.Object implements java.io.SerializableRepresents a globally unique Id.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description UniqueId()Constructs a new UniqueId with a null identifier.UniqueId(byte[] id)Constructs a new UniqueId from the given byte array.UniqueId(byte[] id, int offset, int length)Constructs a new UniqueId from a portion of the given byte array.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object other)byte[]getBytes()Returns the raw bytes of this unique identifier.inthashCode()java.lang.StringtoString()
-
-
-
Constructor Detail
-
UniqueId
public UniqueId()
Constructs a new UniqueId with a null identifier.
-
UniqueId
public UniqueId(byte[] id)
Constructs a new UniqueId from the given byte array.- Parameters:
id- the byte array containing the identifier
-
UniqueId
public UniqueId(byte[] id, int offset, int length)Constructs a new UniqueId from a portion of the given byte array.- Parameters:
id- the source byte arrayoffset- the start offsetlength- the number of bytes
-
-
Method Detail
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
getBytes
public byte[] getBytes()
Returns the raw bytes of this unique identifier.- Returns:
- the byte array
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-