Package org.eclipse.ecf.core.identity
Class BaseID
java.lang.Object
org.eclipse.ecf.core.identity.BaseID
- All Implemented Interfaces:
Serializable,Comparable,Principal,org.eclipse.core.runtime.IAdaptable,ID
- Direct Known Subclasses:
FileTransferID,LongID,R_OSGiID,RemoteServiceID,ServiceID,ServiceTypeID,StringID,URIID,UuID
Base class for ID implementation classes
Extensions for the org.eclipse.ecf.namespace extension point that
expose new Namespace subclasses and their own ID implementations are
recommended (but not required) to use this class as a superclass.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintbooleangetAdapter(Class clazz) getName()Get the unique name of this identity.Get the Namespace instance associated with this identityinthashCode()protected abstract intprotected abstract booleanCalled byNamespace.testIDEquals(BaseID, BaseID).protected abstract StringCalled byNamespace.getNameForID(BaseID).protected abstract intCalled byNamespace.getHashCodeForID(BaseID).protected StringCalled byNamespace.toExternalForm(BaseID).Get this ID instance in String form.
-
Field Details
-
namespace
-
-
Constructor Details
-
BaseID
public BaseID()- Since:
- 3.9
-
BaseID
-
-
Method Details
-
compareTo
- Specified by:
compareToin interfaceComparable
-
equals
-
getName
Description copied from interface:IDGet the unique name of this identity. -
getNamespace
Description copied from interface:IDGet the Namespace instance associated with this identity- Specified by:
getNamespacein interfaceID- Returns:
- Namespace the Namespace corresponding to this identity. Will not return null.
-
hashCode
public int hashCode() -
toExternalForm
Description copied from interface:IDGet this ID instance in String form. Will not return null.- Specified by:
toExternalFormin interfaceID- Returns:
- String that is external representation of this ID
-
namespaceCompareTo
- Parameters:
o- the other ID to compare to. Will not benull.- Returns:
- the appropriate value as per
Comparablecontract.
-
namespaceEquals
Called byNamespace.testIDEquals(BaseID, BaseID).- Parameters:
o- the other ID to test against. May benull.- Returns:
trueif this ID is equal to the given ID.falseotherwise.
-
namespaceGetName
Called byNamespace.getNameForID(BaseID).- Returns:
- String name for this ID. Must not be
null. Value returned should be unique within this Namespace.
-
namespaceHashCode
protected abstract int namespaceHashCode()Called byNamespace.getHashCodeForID(BaseID).- Returns:
- int hashCode for this ID. Returned value must be unique within this process.
-
namespaceToExternalForm
Called byNamespace.toExternalForm(BaseID).- Returns:
- String that represents this ID. Default implementation is to return
namespace.getScheme() + Namespace.SCHEME_SEPARATOR + namespaceGetName();
-
getAdapter
- Specified by:
getAdapterin interfaceorg.eclipse.core.runtime.IAdaptable
-