Package com.sodius.oslc.server.process
Interface ResourceDiff.PropertyValidator
-
- Enclosing class:
- ResourceDiff<T extends IExtendedResource>
public static interface ResourceDiff.PropertyValidatorA 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 booleanignoreOriginalValues()Indicate to ignore this validator on original values during the diff.booleanisValidDefinition(URI propertyDefinition)Checks whether a property with the given definition should be processed with the diff.booleanisValidValue(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
valueis nevernulland 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
implementsRequirementis a valid property.An element with 2 links:
- 1
implementsRequirementtargeting A - 1
affectedByDefecttargeting B
- 1
implementsRequirementtargeting C - 1
affectedByDefecttargeting D
- 1
implementsRequirementtargeting C
- 1
implementsRequirementtargeting C - 1
affectedByDefecttargeting 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
-
-