|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface IModelObjectDelta
A model object delta represents the delta between two model objects. The two model objects must be instances of the same model class. One typical use case is that the two (technical) objects represent the same business object but at two different points in time.
| Field Summary | |
|---|---|
static int |
ADDED
Delta kind constant indicating that the model object has been added to it's parent. |
static int |
CHANGED
Delta kind constant indicating that the model object has changed somehow. |
static int |
CHILD_CHANGED
Delta change type constant indicating that at least one child (that has neither been added or removed or just moved) has changed. |
static int |
CLASS_CHANGED
Delta change type constant indicating that the class of the object has changed. |
static int |
DIFFERENT_OBJECT_AT_POSITION
Delta kind constant indicating that a different model object is now at a given position. |
static int |
EMPTY
Constant indicating that the delta is empty, no difference exists between the two objects. |
static int |
MOVED
Delta kind constant indicating that the model object has been moved, meaning it's position in the ordered list of objects has been changed. |
static int |
PROPERTY_CHANGED
Delta change type constant indicating that at least one of the object's properties has changed. |
static int |
REMOVED
Delta kind constant indicating that the model object has been removed from it's parent. |
static int |
STRUCTURE_CHANGED
Delta change type constant indicating that the object's structure has changed, that means either a child has been added, removed or changed its position (if the computation method is IDeltaComputationOptions.ComputationMethod.BY_OBJECT or a different object is now at
a given position (if the computation method is
IDeltaComputationOptions.ComputationMethod.BY_OBJECT. |
| Method Summary | |
|---|---|
void |
accept(IModelObjectDeltaVisitor visitor)
Accepts the given visitor. |
String |
getAssociation()
The name of the association to that the object has been added / has been removed from or is moved in. |
List<String> |
getChangedProperties()
Returns the properties that have a different a value in the model object and the reference model object. |
List<IModelObjectDelta> |
getChildDeltas()
Returns deltas for all children of the model object which were added, removed, or changed. |
List<IModelObjectDelta> |
getChildDeltas(int kind)
Returns deltas for all children of this model object whose kind is included in the given mask. |
int |
getKind()
Returns the kind of change. |
int |
getKindOfChange()
If delta's kind is CHANGED, this method returns the kind of changed defined by the
constant listed below. |
IModelObject |
getOriginalObject()
The model object this delta is computed for. |
IModelObject |
getReferenceObject()
The model object that is taken as a reference to which the orginal model object is compared to. |
boolean |
isAdded()
Returns true if this model object has been added to its parent,
false otherwise. |
boolean |
isChanged()
Returns true if this model object has been changed. |
boolean |
isChildChanged()
Returns true if at least one model object's children has been changed. |
boolean |
isClassChanged()
Returns true if the model object's Java class has "changed". |
boolean |
isDifferentObjectAtPosition()
Returns true if a different model object is at a position, otherwise
false. |
boolean |
isEmpty()
Returns true if the delta is empty, the two objects are the same, otherwise
false. |
boolean |
isMoved()
Returns true if this model object has changed its position in the ordered
association. |
boolean |
isPropertyChanged()
Returns true if at least one the model object's properties has changed,
otherwise false. |
boolean |
isPropertyChanged(String propertyName)
Returns true if the model object contains a different value for the given
property than then reference model object. |
boolean |
isRemoved()
Returns true if this model object has been removed from its parent,
false otherwise. |
boolean |
isStructureChanged()
Returns true if this model object's structure has changed. |
| Field Detail |
|---|
static final int EMPTY
If the object is a root object, this means that all properties are equal, no children have been removed, added or have changed their position.
If this object is a dependent object (it belongs to a parent), this means that all properties are equal and this object has neither been added to or removed from its parent nor has the position of the object changed.
static final int ADDED
static final int REMOVED
static final int MOVED
IDeltaComputationOptions.ComputationMethod.BY_OBJECT.
Note that an object can be moved and changed! In this case getKind() returns MOVED & CHANGED.
static final int DIFFERENT_OBJECT_AT_POSITION
IDeltaComputationOptions.ComputationMethod.BY_POSITION.
static final int CHANGED
Note that an object can be moved and changed! In this case getKind() returns MOVED & CHANGED.
STRUCTURE_CHANGED,
PROPERTY_CHANGED,
CHILD_CHANGED,
Constant Field Valuesstatic final int STRUCTURE_CHANGED
IDeltaComputationOptions.ComputationMethod.BY_OBJECT or a different object is now at
a given position (if the computation method is
IDeltaComputationOptions.ComputationMethod.BY_OBJECT.
static final int PROPERTY_CHANGED
static final int CHILD_CHANGED
static final int CLASS_CHANGED
| Method Detail |
|---|
IModelObject getOriginalObject()
null.
IModelObject getReferenceObject()
If this is a delta for a a child that was removed from the orginial model object, the method
returns null.
int getKind()
EMPTY,
ADDED,
REMOVED,
MOVED,
DIFFERENT_OBJECT_AT_POSITION,
CHANGEDint getKindOfChange()
CHANGED, this method returns the kind of changed defined by the
constant listed below. Not that the kind of changes are not mututally excluded, so the
returned kinds are bit masked. The method returns 0, if the delta's kind is not
CHANGED.
PROPERTY_CHANGED,
STRUCTURE_CHANGED,
CHILD_CHANGEDboolean isEmpty()
true if the delta is empty, the two objects are the same, otherwise
false.
boolean isAdded()
true if this model object has been added to its parent,
false otherwise.
boolean isRemoved()
true if this model object has been removed from its parent,
false otherwise.
boolean isMoved()
true if this model object has changed its position in the ordered
association. This type of delta is only returned if the computation method is
IDeltaComputationOptions.ComputationMethod.BY_OBJECT.
boolean isDifferentObjectAtPosition()
true if a different model object is at a position, otherwise
false. This type of delta is only returned if the computation method is
IDeltaComputationOptions.ComputationMethod.BY_POSITION.
boolean isChanged()
true if this model object has been changed.
boolean isStructureChanged()
true if this model object's structure has changed. That means either a
child has been added or removed or a child has been been moved.
boolean isClassChanged()
true if the model object's Java class has "changed". (Technically its of
course just an instance of another class). Returns false otherwise.
boolean isPropertyChanged()
true if at least one the model object's properties has changed,
otherwise false.
boolean isChildChanged()
true if at least one model object's children has been changed.
String getAssociation()
List<String> getChangedProperties()
boolean isPropertyChanged(String propertyName)
true if the model object contains a different value for the given
property than then reference model object. Returns false otherwise. Returns
false if propertyName is null.
List<IModelObjectDelta> getChildDeltas()
List<IModelObjectDelta> getChildDeltas(int kind)
IModelObjectDelta kind
constants. Returns an empty array if there are no affected children.
void accept(IModelObjectDeltaVisitor visitor)
The visitor's visit method is called. If the visitor returns true,
the delta's children are also visited.
visitor - the visitor
NullPointerException - if visitor is null.IModelObjectDeltaVisitor.visit(IModelObjectDelta)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||