Class Id

  • All Implemented Interfaces:
    StringValue, java.io.Serializable, java.lang.Comparable<Id>

    @Immutable
    public class Id
    extends java.lang.Object
    implements java.io.Serializable, java.lang.Comparable<Id>, StringValue
    An opaque wrapper for identifiers.
    Author:
    Fabrizio Giudici
    See Also:
    Serialized Form
    Status: stable API
    • Constructor Summary

      Constructors 
      Constructor Description
      Id()  
    • Constructor Detail

      • Id

        public Id()
    • Method Detail

      • of

        @Nonnull
        public static Id of​(@Nonnull
                            java.lang.Object value)
        Parameters:
        value - the id value
        Returns:
        the new instance
        Since:
        3.2-ALPHA-2
      • ofUuid

        @Nonnull
        public static Id ofUuid()
        Returns:
        the new instance
        Since:
        3.2-ALPHA-9
      • stringValue

        @Nonnull
        public java.lang.String stringValue()
        Returns the String value of this object.
        Specified by:
        stringValue in interface StringValue
        Returns:
        the string
      • compareTo

        public int compareTo​(Id other)
        Specified by:
        compareTo in interface java.lang.Comparable<Id>
      • toString

        @Nonnull
        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object