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 intcompareTo(Id other)static Idof(java.lang.Object value)static IdofUuid()java.lang.StringstringValue()Returns theStringvalue of this object.java.lang.StringtoString()
-
-
-
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 theStringvalue of this object.- Specified by:
stringValuein interfaceStringValue- Returns:
- the string
-
compareTo
public int compareTo(Id other)
- Specified by:
compareToin interfacejava.lang.Comparable<Id>
-
toString
@Nonnull public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-