Package com.sodius.oslc.server.process
Interface ResourceDiff.PropertyValidator
-
- Enclosing class:
- ResourceDiff<T extends IExtendedResource>
public static interface ResourceDiff.PropertyValidator
A validator that checks whether a property should be taken into account while computing the diff between 2 resources.- Since:
- 1.14.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default boolean
ignoreOriginalValues()
Indicate to ignore this validator on original values during the diff.boolean
isValidDefinition(URI propertyDefinition)
Checks whether a property with the given definition should be processed with the diff.boolean
isValidValue(URI propertyDefinition, Object value)
Checks whether a property with the given value should be processed with the diff.
-
-
-
Method Detail
-
isValidDefinition
boolean isValidDefinition(URI propertyDefinition)
Checks whether a property with the given definition should be processed with the diff.- Parameters:
propertyDefinition
- the property definition- Returns:
- true if the property should be processed with the diff, false if it should be ignored
-
isValidValue
boolean isValidValue(URI propertyDefinition, Object value)
Checks whether a property with the given value should be processed with the diff.Note that
value
is nevernull
and is never an array or a collection. If a property contains several values, this method is called once for each value.If
isValidDefinition(URI)
returnsfalse
, this method is not called.- Parameters:
propertyDefinition
- the property definitionvalue
- the property value- Returns:
- true if the property should be processed with the diff, false if it should be ignored
-
ignoreOriginalValues
default boolean ignoreOriginalValues()
Indicate to ignore this validator on original values during the diff. This allows to remove elements even if the properties are not validated. Validation will still be done when creating elements.Example: Only
implementsRequirement
is a valid property.An element with 2 links:
- 1
implementsRequirement
targeting A - 1
affectedByDefect
targeting B
- 1
implementsRequirement
targeting C - 1
affectedByDefect
targeting D
- 1
implementsRequirement
targeting C
- 1
implementsRequirement
targeting C - 1
affectedByDefect
targeting B
- Returns:
- a boolean to indicate if validator has to be checked on original value or not
- Since:
- 3.1.0
- See Also:
ResourceDiff.ResourceDiffBuilder.build()
- 1
-
-