public class StringID extends BaseID
Modifier and Type | Class and Description |
---|---|
static class |
StringID.StringIDNamespace |
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
value |
Modifier | Constructor and Description |
---|---|
protected |
StringID(Namespace n,
java.lang.String s)
Protected constructor for factory-based construction
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(java.lang.Object o) |
boolean |
equals(java.lang.Object o) |
java.lang.String |
getName()
Get the unique name of this identity.
|
Namespace |
getNamespace()
Get the Namespace instance associated with this identity
|
int |
hashCode() |
protected int |
namespaceCompareTo(BaseID obj)
|
protected boolean |
namespaceEquals(BaseID obj)
Called by
Namespace.testIDEquals(BaseID, BaseID) . |
protected java.lang.String |
namespaceGetName()
Called by
Namespace.getNameForID(BaseID) . |
protected int |
namespaceHashCode()
Called by
Namespace.getHashCodeForID(BaseID) . |
protected void |
setEmptyNamespace() |
java.lang.String |
toExternalForm()
Get this ID instance in String form.
|
java.lang.String |
toString() |
getAdapter, namespaceToExternalForm
protected StringID(Namespace n, java.lang.String s)
n
- the Namespace this identity will belong tos
- the String defining this StringIDpublic int compareTo(java.lang.Object o)
public boolean equals(java.lang.Object o)
public java.lang.String getName()
ID
public int hashCode()
public Namespace getNamespace()
ID
getNamespace
in interface ID
getNamespace
in class BaseID
public java.lang.String toExternalForm()
ID
toExternalForm
in interface ID
toExternalForm
in class BaseID
public java.lang.String toString()
toString
in interface java.security.Principal
toString
in class java.lang.Object
protected int namespaceCompareTo(BaseID obj)
BaseID
namespaceCompareTo
in class BaseID
obj
- the other ID to compare to. Will not be null
.Comparable
contract.protected boolean namespaceEquals(BaseID obj)
BaseID
Namespace.testIDEquals(BaseID, BaseID)
.namespaceEquals
in class BaseID
obj
- the other ID to test against. May be null
.true
if this ID is equal to the given ID.
false
otherwise.protected java.lang.String namespaceGetName()
BaseID
Namespace.getNameForID(BaseID)
.namespaceGetName
in class BaseID
null
. Value
returned should be unique within this Namespace.protected int namespaceHashCode()
BaseID
Namespace.getHashCodeForID(BaseID)
.namespaceHashCode
in class BaseID
protected void setEmptyNamespace()