Package com.saperion.common.lang.id
Class StringId
- java.lang.Object
-
- com.saperion.common.lang.id.StringId
-
- Direct Known Subclasses:
HierarchicalName
public class StringId extends java.lang.Object implements Id, java.lang.Comparable<StringId>
A simple
String-based id.An instance of
StringIdcan be used in several threads concurrently.- Author:
- agz
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description StringId(java.lang.String id)Creates a newString-based id.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(StringId id)booleanequals(java.lang.Object obj)java.lang.StringgetString()Returns the string-representation of thisId.inthashCode()java.lang.StringtoString()ThistoString()-method returns a full representation of aStringIdwhich is compatible with theconstructor.
-
-
-
Method Detail
-
getString
public final java.lang.String getString()
Description copied from interface:IdReturns the string-representation of thisId.
-
equals
public final boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public final int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
compareTo
public final int compareTo(StringId id)
- Specified by:
compareToin interfacejava.lang.Comparable<StringId>
-
toString
public final java.lang.String toString()
ThistoString()-method returns a full representation of aStringIdwhich is compatible with theconstructor. So thistoString()-method is usable in business-logic and not only for debugging purposes.- Overrides:
toStringin classjava.lang.Object
-
-