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
StringId
can 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 int
compareTo(StringId id)
boolean
equals(java.lang.Object obj)
java.lang.String
getString()
Returns the string-representation of thisId
.int
hashCode()
java.lang.String
toString()
ThistoString()
-method returns a full representation of aStringId
which is compatible with theconstructor
.
-
-
-
Method Detail
-
getString
public final java.lang.String getString()
Description copied from interface:Id
Returns the string-representation of thisId
.
-
equals
public final boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public final int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
compareTo
public final int compareTo(StringId id)
- Specified by:
compareTo
in interfacejava.lang.Comparable<StringId>
-
toString
public final java.lang.String toString()
ThistoString()
-method returns a full representation of aStringId
which is compatible with theconstructor
. So thistoString()
-method is usable in business-logic and not only for debugging purposes.- Overrides:
toString
in classjava.lang.Object
-
-