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 of ResourceDiff.
Since:
1.14.0
See Also:
  • Method Details

    • oslcProperties

      public ResourceDiff.ResourceDiffBuilder<T> oslcProperties(OslcProperties properties)
      Validates that a property is contained in the given OslcProperties. 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:
      1. The link type source range is valid for the current resource type.
      2. The link type is supported by the current application, as defined in ProcessScope.
      3. The friend provider contains a friend compatible with the URI of the link target.
      4. When in strict mode, the right association is set on the project for the link types to handle
      Parameters:
      friendProvider - the friend provider
      projectId - 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

      public ResourceDiff<T> build()
      Creates a ResourceDiff with the parameters configured in this builder instance.
      Returns:
      the ResourceDiff