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
A string-based identity
- See Also:
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
boolean
getName()
Get the unique name of this identity.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
Called byNamespace.getNameForID(BaseID)
.protected int
Called byNamespace.getHashCodeForID(BaseID)
.protected void
Get this ID instance in String form.toString()
Methods inherited from class org.eclipse.ecf.core.identity.BaseID
getAdapter, namespaceToExternalForm
-
Field Details
-
value
-
-
Constructor Details
-
StringID
public StringID()- Since:
- 3.9
-
StringID
Protected constructor for factory-based construction- Parameters:
n
- the Namespace this identity will belong tos
- the String defining this StringID
-
-
Method Details
-
compareTo
- Specified by:
compareTo
in interfaceComparable
- Overrides:
compareTo
in classBaseID
-
equals
-
getName
Description copied from interface:ID
Get the unique name of this identity. -
hashCode
public int hashCode() -
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
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
-
namespaceCompareTo
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
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
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()
-