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
,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 TypeMethodDescriptionint
boolean
getAdapter
(Class clazz) getName()
Get the unique name of this identity.Get the Namespace instance associated with this identityint
hashCode()
protected abstract int
protected abstract boolean
Called byNamespace.testIDEquals(BaseID, BaseID)
.protected abstract String
Called byNamespace.getNameForID(BaseID)
.protected abstract int
Called byNamespace.getHashCodeForID(BaseID)
.protected String
Called 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:
compareTo
in interfaceComparable
-
equals
-
getName
Description copied from interface:ID
Get the unique name of this identity. -
getNamespace
Description copied from interface:ID
Get the Namespace instance associated with this identity- Specified by:
getNamespace
in interfaceID
- Returns:
- Namespace the Namespace corresponding to this identity. Will not return null.
-
hashCode
public int hashCode() -
toExternalForm
Description copied from interface:ID
Get this ID instance in String form. Will not return null.- Specified by:
toExternalForm
in 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
Comparable
contract.
-
namespaceEquals
Called byNamespace.testIDEquals(BaseID, BaseID)
.- Parameters:
o
- the other ID to test against. May benull
.- Returns:
true
if this ID is equal to the given ID.false
otherwise.
-
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:
getAdapter
in interfaceorg.eclipse.core.runtime.IAdaptable
-