Record Class UUIDIdentifier

java.lang.Object
java.lang.Record
com.buralotech.oss.identifier.uuid.UUIDIdentifier
Record Components:
text - The textual representation.
binary - The binary representation.
All Implemented Interfaces:
Identifier, Comparable<Identifier>

public record UUIDIdentifier(String text, byte[] binary) extends Record implements Identifier
And identifier has a textual and binary representation.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final byte[]
    The field for the binary record component.
    private final String
    The field for the text record component.
  • Constructor Summary

    Constructors
    Constructor
    Description
    UUIDIdentifier(String text, byte[] binary)
    Creates an instance of a UUIDIdentifier record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    byte[]
    Returns the value of the binary record component.
    int
    Compare based on the binary representation.
    boolean
    equals(Object other)
    Determine if two identifiers are equivalent.
    int
    Calculate a hash code for an identifier.
    Returns the value of the text record component.
    Get a string representation.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • text

      private final String text
      The field for the text record component.
    • binary

      private final byte[] binary
      The field for the binary record component.
  • Constructor Details

    • UUIDIdentifier

      public UUIDIdentifier(String text, byte[] binary)
      Creates an instance of a UUIDIdentifier record class.
      Parameters:
      text - the value for the text record component
      binary - the value for the binary record component
  • Method Details

    • equals

      public boolean equals(Object other)
      Determine if two identifiers are equivalent.
      Specified by:
      equals in class Record
      Parameters:
      other - The other identifier.
      Returns:
      true if the two identifiers are equivalent. Otherwise, false.
    • hashCode

      public int hashCode()
      Calculate a hash code for an identifier.
      Specified by:
      hashCode in class Record
      Returns:
      The hash code.
    • compareTo

      public int compareTo(Identifier other)
      Compare based on the binary representation.
      Specified by:
      compareTo in interface Comparable<Identifier>
      Parameters:
      other - the object to be compared.
      Returns:
      • 0 - if the two identifiers are equivalent
      • < 0 -
      • > 0 -
    • toString

      public String toString()
      Get a string representation.
      Specified by:
      toString in class Record
      Returns:
      The string representation.
    • text

      public String text()
      Returns the value of the text record component.
      Specified by:
      text in interface Identifier
      Returns:
      the value of the text record component
    • binary

      public byte[] binary()
      Returns the value of the binary record component.
      Specified by:
      binary in interface Identifier
      Returns:
      the value of the binary record component