public class DeltaComputationOptionsByPosition extends Object implements IDeltaComputationOptions
IDeltaComputationOptions.ComputationMethod.BY_POSITIONIDeltaComputationOptions.ComputationMethod| Constructor and Description |
|---|
DeltaComputationOptionsByPosition() |
| Modifier and Type | Method and Description |
|---|---|
IDeltaComputationOptions.ComputationMethod |
getMethod(String association)
Returns if the delta computation computes child deltas per position/index or per object.
|
boolean |
ignore(Class<?> clazz,
String property)
Returns
false. |
boolean |
isSame(IModelObject object1,
IModelObject object2)
Returns
true if the specified object references are identical. |
public IDeltaComputationOptions.ComputationMethod getMethod(String association)
IDeltaComputationOptions
1. Example for a 1-many association:
A contract version A has three coverages c0, c1, and c2. A second version B of the same
contract has a new coverage cNew inserted between coverage c0 and c1. The coverages c0,
c1,and c2 are unchanged except for their position.
If this method returns IDeltaComputationOptions.ComputationMethod.BY_POSITION, the following deltas are
computed. position 0: version A:c0, version B:c0 => empty delta position 1: version A:c1,
version B:cNew => changed position 2: version A:c2, version B:c1 => changed position 3:
version A:none, version B:c2 => added
If this method returns IDeltaComputationOptions.ComputationMethod.BY_OBJECT, the following deltas are
computed. c0: version A:position 0, version B:position 0 => empty delta c1: version
A:position 1, version B:position 2 => moved c2: version A:position 2, version B:position 3 =>
moved cNew: version A:position none, version B:position 1 => added
2. Example for a 1-many association:
Same scenario as above, but now c1 is removed and no coverage is added.
If this method returns IDeltaComputationOptions.ComputationMethod.BY_POSITION, the following deltas are
computed. position 0: version A:c0, version B:c0 => empty delta position 1: version A:c1,
version B:v2 => changed position 2: version A:c2, version B:none => removed
If this method returns IDeltaComputationOptions.ComputationMethod.BY_OBJECT, the following deltas are
computed. c0: version A:position 0, version B:position 0 => empty delta c1: version
A:position 1, version B:position none => removed c2: version A:position 2, version B:position
1 => moved
Example for a 1-1 association:
A contract version A has the insured person p0. A second contract version B has the insured
person p1.
If this method returns IDeltaComputationOptions.ComputationMethod.BY_POSITION, the following delta is
computed. position 0: changed
If this method returns IDeltaComputationOptions.ComputationMethod.BY_OBJECT, the following deltas are
computed. p1: removed p2: added
getMethod in interface IDeltaComputationOptionspublic boolean isSame(IModelObject object1, IModelObject object2)
true if the specified object references are identical.isSame in interface IDeltaComputationOptionspublic boolean ignore(Class<?> clazz, String property)
false.ignore in interface IDeltaComputationOptionsclazz - The class the property belongs to.property - The name of the property.Copyright © 2014. All rights reserved.