|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ICloneObject
Base interface for all CPC Data Objects.
Any implementation needs to implement ICloneObjectInterfaces
.
Implementing only ICloneObject
is not enough!
This interface lists all methods which are available to all CPC plugins and 3rd party contributions.
Additional methods are defined by more specific sub-interfaces
(in the *.api.data.special package) which belong to individual CPC plugins
and are to be considered private.
Any CPC plugin other than the one designated in the sub-interface API must not access
such methods.
This does not apply to the main sub-interfaces in the *.api.data package.
General Considerations valid for all types of CPC Data Objects:
ICloneObjectInterfaces
,
IAdaptable
,
Serializable
,
Cloneable
Field Summary | |
---|---|
static java.lang.String |
PERSISTENCE_OBJECT_IDENTIFIER
IStatefulObject persistence object identifier, value: "uuid" |
Method Summary | |
---|---|
void |
addExtension(ICloneObjectExtension extension)
Adds an ICloneObjectExtension to this clone object. |
java.lang.Object |
clone()
All implementations must be cloneable. |
boolean |
equals(java.lang.Object obj)
Equality based on uuid. |
boolean |
equalsAll(ICloneObject otherCloneObject)
Checks not only the uuid but ALL data fields for equality. |
ICloneObjectExtension |
getExtension(java.lang.Class<? extends ICloneObjectExtension> extensionClass)
Retrieves an ICloneObjectExtension which has been added to this clone object. |
java.util.List<ICloneObjectExtension> |
getExtensions()
Retrieves a list of all currently added ICloneObjectExtension s for this clone object
which have not been deleted. |
java.lang.String |
getUuid()
Retrieves the uuid which uniquely identifies this object. |
boolean |
hasExtensions()
Cached boolean value which indicates whether there is currently any ICloneObjectExtension
added to this clone object. |
int |
hashCode()
HashCode based on uuid. |
boolean |
isMarked()
Checks whether this clone object has been marked. |
void |
removeExtension(java.lang.Class<? extends ICloneObjectExtension> extensionClass)
Removes any ICloneObjectExtension of the given type from this ICloneObject . |
void |
removeExtension(ICloneObjectExtension extension)
Removes any ICloneObjectExtension which matches the ICloneObjectExtension.getExtensionInterfaceClass()
value of the given extension from this ICloneObject . |
void |
setMarked(boolean marked)
Marks or unmarks a clone object. |
java.lang.String |
toString()
All implementations should provide a meaningful toString() method for debugging purposes. |
Methods inherited from interface org.electrocodeogram.cpc.core.api.data.ICloneDataElement |
---|
isSealed, seal |
Methods inherited from interface org.eclipse.core.runtime.IAdaptable |
---|
getAdapter |
Field Detail |
---|
static final java.lang.String PERSISTENCE_OBJECT_IDENTIFIER
IStatefulObject
persistence object identifier, value: "uuid"
Method Detail |
---|
java.lang.String getUuid()
This value has to be initialised during the construction of an object.
boolean isMarked()
A typical use for marks is to pass info on some kind of selection of clone objects from
a list between method calls without having to create an additional list or having to
add an ICloneObjectExtension
.
Marks are not persisted.
NOTE: Marks have no meaning outside of the module which set them. They exist
only due to performance considerations. If you need to store some data for
a clone object which will be handled by other modules, you should use
getExtension(Class)
instead.
Whenever a clone object leaves your module, you should consider all marks to be lost/corrupted.
void setMarked(boolean marked)
Marks are not persisted.
Be sure to read the limitations for the usage of marks, see: isMarked()
marked
- whether this instance should be marked or not.isMarked()
boolean hasExtensions()
ICloneObjectExtension
added to this clone object.
ICloneObject
.
ICloneObjectExtension getExtension(java.lang.Class<? extends ICloneObjectExtension> extensionClass)
ICloneObjectExtension
which has been added to this clone object.
If no extension of this type has been added, null is returned.
extensionClass
- the extension type to retrieve, never null
ICloneObjectExtension
java.util.List<ICloneObjectExtension> getExtensions()
ICloneObjectExtension
s for this clone object
which have not been deleted.
ICloneObjectExtension
void addExtension(ICloneObjectExtension extension)
ICloneObjectExtension
to this clone object.
ICloneObjectExtension
will be registered under the class returned by its
ICloneObjectExtension.getExtensionInterfaceClass()
method.
There can only be one extension of a given type at any time. Adding an extension while another extension of the same type is already registered, will replace the existing extension.
NOTE: in the current implementation stateful extensions will only be persisted for IClone
objects.
extension
- the extension to add, will replace any existing extension of the same type, never null.ICloneObjectExtension
void removeExtension(java.lang.Class<? extends ICloneObjectExtension> extensionClass)
ICloneObjectExtension
of the given type from this ICloneObject
.
extensionClass
- the interface type for which a registered extension should be removed, never null.IStoreCloneObject.getDeletedExtensions()
,
IStoreCloneObject.purgeDeletedExtensions()
void removeExtension(ICloneObjectExtension extension)
ICloneObjectExtension
which matches the ICloneObjectExtension.getExtensionInterfaceClass()
value of the given extension from this ICloneObject
.
removeExtension(Class)
.
extension
- the ICloneObjectExtension
for which any extension of equal type should be removed, never null.removeExtension(Class)
boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
int hashCode()
hashCode
in class java.lang.Object
boolean equalsAll(ICloneObject otherCloneObject)
otherCloneObject
- clone object to compare to, may be null, may be same instance
java.lang.Object clone() throws java.lang.CloneNotSupportedException
java.lang.CloneNotSupportedException
java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |