Package com.sodius.oslc.server.process
Class ResourceDiff.ResourceDiffBuilder<T extends IExtendedResource>
java.lang.Object
com.sodius.oslc.server.process.ResourceDiff.ResourceDiffBuilder<T>
- Type Parameters:
T- the type of resources to compare
- Enclosing class:
ResourceDiff<T extends IExtendedResource>
Builds an instance of
ResourceDiff.- Since:
- 1.14.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Creates a ResourceDiff with the parameters configured in this builder instance.oslcLinks(FriendProvider friendProvider, String projectId) Validates that all OSLC links found while processing the diff conform to the following: The link type source range is valid for the current resource type.oslcProperties(OslcProperties properties) Validates that a property is contained in the givenOslcProperties.resourceShape(ResourceShape shape) Validates that a property is declared in the given resource shape and that it is not read-only.validators(ResourceDiff.PropertyValidator... validators) Applies custom validator(s) on resource properties before they are processed in the resource diff.
-
Method Details
-
oslcProperties
Validates that a property is contained in the givenOslcProperties. If it isn't, the property is ignored while processing the resource diff.- Parameters:
properties- the accepted OSLC properties- Returns:
- the builder instance
-
resourceShape
Validates that a property is declared in the given resource shape and that it is not read-only. Otherwise, the property is ignored while processing the resource diff.- Parameters:
shape- the resource shape- Returns:
- the builder instance
-
oslcLinks
public ResourceDiff.ResourceDiffBuilder<T> oslcLinks(FriendProvider friendProvider, String projectId) Validates that all OSLC links found while processing the diff conform to the following:- The link type source range is valid for the current resource type.
- The link type is supported by the current application, as defined in
ProcessScope. - The friend provider contains a friend compatible with the URI of the link target.
- When in strict mode, the right association is set on the project for the link types to handle
- Parameters:
friendProvider- the friend providerprojectId- the target project's identifier- Returns:
- the builder instance
- Since:
- 3.1.0
-
validators
Applies custom validator(s) on resource properties before they are processed in the resource diff.- Parameters:
validators- the validators to apply- Returns:
- the builder instance
-
build
Creates a ResourceDiff with the parameters configured in this builder instance.- Returns:
- the ResourceDiff
-