Class UniqueId

  • All Implemented Interfaces:
    java.io.Serializable

    public final class UniqueId
    extends java.lang.Object
    implements java.io.Serializable
    Represents 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
      boolean equals​(java.lang.Object other)  
      byte[] getBytes()
      Returns the raw bytes of this unique identifier.
      int hashCode()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • 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 array
        offset - the start offset
        length - the number of bytes
    • Method Detail

      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.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:
        toString in class java.lang.Object