Class ResourceDiff<T extends IExtendedResource>

java.lang.Object
com.sodius.oslc.server.process.ResourceDiff<T>
Type Parameters:
T - the type of resources to compare

public class ResourceDiff<T extends IExtendedResource> extends Object
The differences between 2 resources of the same type.
Since:
1.14.0
  • Method Details

    • of

      public static <T extends IExtendedResource> ResourceDiff.ResourceDiffBuilder<T> of(T original, T updated)
      Instantiates a builder to create a ResourceDiff instance between 2 resources.
      Type Parameters:
      T - the type of resources to compare
      Parameters:
      original - the original resource
      updated - the updated resource
      Returns:
      a builder to create a resource diff
    • getResource

      public T getResource()
      Returns the original resource, updated with all the diff additions and removals.
      Returns:
      the original resource, updated with all the diff additions and removals
    • getAdditions

      public T getAdditions()
      Returns a resource that contains only the properties added to the original resource.
      Returns:
      a resource that contains only the properties added to the original resource
    • getRemovals

      public T getRemovals()
      Returns a resource that contains only the properties removed from the original resource.
      Returns:
      a resource that contains only the properties removed from the original resource
    • isModified

      public boolean isModified()
      Returns true if this resource diff contains at least 1 addition or 1 removal.
      Returns:
      true if this resource diff contains at least 1 addition or 1 removal, false otherwise