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
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintbooleangetName()Get the unique name of this identity.Get the Namespace instance associated with this identityinthashCode()protected intnamespaceCompareTo(BaseID obj) protected booleannamespaceEquals(BaseID obj) Called byNamespace.testIDEquals(BaseID, BaseID).protected StringCalled byNamespace.getNameForID(BaseID).protected intCalled byNamespace.getHashCodeForID(BaseID).protected voidGet 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:
compareToin interfaceComparable- Overrides:
compareToin classBaseID
-
equals
-
getName
Description copied from interface:IDGet the unique name of this identity. -
hashCode
public int hashCode() -
getNamespace
Description copied from interface:IDGet the Namespace instance associated with this identity- Specified by:
getNamespacein interfaceID- Overrides:
getNamespacein classBaseID- Returns:
- Namespace the Namespace corresponding to this identity. Will not return null.
-
toExternalForm
Description copied from interface:IDGet this ID instance in String form. Will not return null.- Specified by:
toExternalFormin interfaceID- Overrides:
toExternalFormin classBaseID- Returns:
- String that is external representation of this ID
-
toString
-
namespaceCompareTo
Description copied from class:BaseID- Specified by:
namespaceCompareToin classBaseID- Parameters:
obj- the other ID to compare to. Will not benull.- Returns:
- the appropriate value as per
Comparablecontract.
-
namespaceEquals
Description copied from class:BaseIDCalled byNamespace.testIDEquals(BaseID, BaseID).- Specified by:
namespaceEqualsin classBaseID- Parameters:
obj- the other ID to test against. May benull.- Returns:
trueif this ID is equal to the given ID.falseotherwise.
-
namespaceGetName
Description copied from class:BaseIDCalled byNamespace.getNameForID(BaseID).- Specified by:
namespaceGetNamein 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:BaseIDCalled byNamespace.getHashCodeForID(BaseID).- Specified by:
namespaceHashCodein classBaseID- Returns:
- int hashCode for this ID. Returned value must be unique within this process.
-
setEmptyNamespace
protected void setEmptyNamespace()
-