Package it.tidalwave.util
Class Id
- java.lang.Object
-
- it.tidalwave.util.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()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Id other)
static Id
of(java.lang.Object value)
static Id
ofUuid()
java.lang.String
stringValue()
Returns theString
value of this object.java.lang.String
toString()
-
-
-
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 theString
value of this object.- Specified by:
stringValue
in interfaceStringValue
- Returns:
- the string
-
compareTo
public int compareTo(Id other)
- Specified by:
compareTo
in interfacejava.lang.Comparable<Id>
-
toString
@Nonnull public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-