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>
public static class ResourceDiff.ResourceDiffBuilder<T extends IExtendedResource> extends Object
Builds an instance ofResourceDiff
.- Since:
- 1.14.0
- See Also:
ResourceDiff.of(IExtendedResource, IExtendedResource)
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ResourceDiff<T>
build()
Creates a ResourceDiff with the parameters configured in this builder instance.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.ResourceDiff.ResourceDiffBuilder<T>
oslcProperties(OslcProperties properties)
Validates that a property is contained in the givenOslcProperties
.ResourceDiff.ResourceDiffBuilder<T>
resourceShape(ResourceShape shape)
Validates that a property is declared in the given resource shape and that it is not read-only.ResourceDiff.ResourceDiffBuilder<T>
validators(ResourceDiff.PropertyValidator... validators)
Applies custom validator(s) on resource properties before they are processed in the resource diff.
-
-
-
Method Detail
-
oslcProperties
public ResourceDiff.ResourceDiffBuilder<T> oslcProperties(OslcProperties properties)
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
public ResourceDiff.ResourceDiffBuilder<T> resourceShape(ResourceShape shape)
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
public ResourceDiff.ResourceDiffBuilder<T> validators(ResourceDiff.PropertyValidator... 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
public ResourceDiff<T> build()
Creates a ResourceDiff with the parameters configured in this builder instance.- Returns:
- the ResourceDiff
-
-