Package org.eclipse.ecf.core.identity
Class StringID
- java.lang.Object
-
- org.eclipse.ecf.core.identity.BaseID
-
- org.eclipse.ecf.core.identity.StringID
-
- All Implemented Interfaces:
Serializable
,Comparable
,Principal
,org.eclipse.core.runtime.IAdaptable
,ID
- Direct Known Subclasses:
GUID
public class StringID extends BaseID
A string-based identity- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
StringID.StringIDNamespace
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Object o)
boolean
equals(Object o)
String
getName()
Get the unique name of this identity.Namespace
getNamespace()
Get the Namespace instance associated with this identityint
hashCode()
protected int
namespaceCompareTo(BaseID obj)
protected boolean
namespaceEquals(BaseID obj)
Called byNamespace.testIDEquals(BaseID, BaseID)
.protected String
namespaceGetName()
Called byNamespace.getNameForID(BaseID)
.protected int
namespaceHashCode()
Called byNamespace.getHashCodeForID(BaseID)
.protected void
setEmptyNamespace()
String
toExternalForm()
Get this ID instance in String form.String
toString()
-
Methods inherited from class org.eclipse.ecf.core.identity.BaseID
getAdapter, namespaceToExternalForm
-
-
-
-
Field Detail
-
value
protected String value
-
-
Method Detail
-
compareTo
public int compareTo(Object o)
- Specified by:
compareTo
in interfaceComparable
- Overrides:
compareTo
in classBaseID
-
equals
public boolean equals(Object o)
-
getName
public String getName()
Description copied from interface:ID
Get the unique name of this identity.
-
hashCode
public int hashCode()
-
getNamespace
public Namespace getNamespace()
Description copied from interface:ID
Get the Namespace instance associated with this identity- Specified by:
getNamespace
in interfaceID
- Overrides:
getNamespace
in classBaseID
- Returns:
- Namespace the Namespace corresponding to this identity. Will not return null.
-
toExternalForm
public String toExternalForm()
Description copied from interface:ID
Get this ID instance in String form. Will not return null.- Specified by:
toExternalForm
in interfaceID
- Overrides:
toExternalForm
in classBaseID
- Returns:
- String that is external representation of this ID
-
toString
public String toString()
-
namespaceCompareTo
protected int namespaceCompareTo(BaseID obj)
Description copied from class:BaseID
- Specified by:
namespaceCompareTo
in classBaseID
- Parameters:
obj
- the other ID to compare to. Will not benull
.- Returns:
- the appropriate value as per
Comparable
contract.
-
namespaceEquals
protected boolean namespaceEquals(BaseID obj)
Description copied from class:BaseID
Called byNamespace.testIDEquals(BaseID, BaseID)
.- Specified by:
namespaceEquals
in classBaseID
- Parameters:
obj
- the other ID to test against. May benull
.- Returns:
true
if this ID is equal to the given ID.false
otherwise.
-
namespaceGetName
protected String namespaceGetName()
Description copied from class:BaseID
Called byNamespace.getNameForID(BaseID)
.- Specified by:
namespaceGetName
in classBaseID
- Returns:
- String name for this ID. Must not be
null
. Value returned should be unique within this Namespace.
-
namespaceHashCode
protected int namespaceHashCode()
Description copied from class:BaseID
Called byNamespace.getHashCodeForID(BaseID)
.- Specified by:
namespaceHashCode
in classBaseID
- Returns:
- int hashCode for this ID. Returned value must be unique within this process.
-
setEmptyNamespace
protected void setEmptyNamespace()
-
-