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 classStringID.StringIDNamespace
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(Object o)booleanequals(Object o)StringgetName()Get the unique name of this identity.NamespacegetNamespace()Get the Namespace instance associated with this identityinthashCode()protected intnamespaceCompareTo(BaseID obj)protected booleannamespaceEquals(BaseID obj)Called byNamespace.testIDEquals(BaseID, BaseID).protected StringnamespaceGetName()Called byNamespace.getNameForID(BaseID).protected intnamespaceHashCode()Called byNamespace.getHashCodeForID(BaseID).protected voidsetEmptyNamespace()StringtoExternalForm()Get this ID instance in String form.StringtoString()-
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:
compareToin interfaceComparable- Overrides:
compareToin classBaseID
-
equals
public boolean equals(Object o)
-
getName
public String getName()
Description copied from interface:IDGet the unique name of this identity.
-
hashCode
public int hashCode()
-
getNamespace
public Namespace 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
public String 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
public String toString()
-
namespaceCompareTo
protected int namespaceCompareTo(BaseID obj)
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
protected boolean namespaceEquals(BaseID obj)
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
protected String 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()
-
-