java.lang.Object
de.powerstat.validation.values.UUID
All Implemented Interfaces:
IValueObject, Comparable<UUID>

public class UUID extends Object implements Comparable<UUID>, IValueObject
Universally Unique Identifier. Possibly DSGVO relevant.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final UUID
    UUID.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    Default constructor.
    private
    UUID(String value)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Compare with another object.
    boolean
    Is equal with another object.
    int
    Calculate hash code.
    static UUID
    of()
    UUID factory.
    static UUID
    of(String value)
    UUID factory.
    Returns the value of this UUID as an String.
    Returns the string representation of this UUID.

    Methods inherited from class java.lang.Object

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

    • uuid

      private final UUID uuid
      UUID.
  • Constructor Details

    • UUID

      private UUID()
      Default constructor.
    • UUID

      private UUID(String value)
      Constructor.
      Parameters:
      value - UUID string value
  • Method Details

    • of

      public static UUID of()
      UUID factory.
      Returns:
      UUID object
    • of

      public static UUID of(String value)
      UUID factory.
      Parameters:
      value - UUID string
      Returns:
      UUID object
    • stringValue

      public String stringValue()
      Returns the value of this UUID as an String.
      Specified by:
      stringValue in interface IValueObject
      Returns:
      The numeric value represented by this object after conversion to type String.
    • hashCode

      public int hashCode()
      Calculate hash code.
      Overrides:
      hashCode in class Object
      Returns:
      Hash
      See Also:
    • equals

      public boolean equals(Object obj)
      Is equal with another object.
      Overrides:
      equals in class Object
      Parameters:
      obj - Object
      Returns:
      true when equal, false otherwise
      See Also:
    • toString

      public String toString()
      Returns the string representation of this UUID. The exact details of this representation are unspecified and subject to change, but the following may be regarded as typical: "UUID[uuid=e58ed763-928c-4155-bee9-fdbaaadc15f3]"
      Overrides:
      toString in class Object
      Returns:
      String representation of this UUID
      See Also:
    • compareTo

      public int compareTo(UUID obj)
      Compare with another object.
      Specified by:
      compareTo in interface Comparable<UUID>
      Parameters:
      obj - Object to compare with
      Returns:
      0: equal; 1: greater; -1: smaller
      See Also: