Package com.sodius.oslc.server.process
Class ResourceDiff<T extends IExtendedResource>
java.lang.Object
com.sodius.oslc.server.process.ResourceDiff<T>
- Type Parameters:
T- the type of resources to compare
The differences between 2 resources of the same type.
- Since:
- 1.14.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceA validator that checks whether a property should be taken into account while computing the diff between 2 resources.static classBuilds an instance ofResourceDiff. -
Method Summary
Modifier and TypeMethodDescriptionReturns a resource that contains only the properties added to the original resource.Returns a resource that contains only the properties removed from the original resource.Returns the original resource, updated with all the diff additions and removals.booleanReturnstrueif this resource diff contains at least 1 addition or 1 removal.static <T extends IExtendedResource>
ResourceDiff.ResourceDiffBuilder<T> of(T original, T updated) Instantiates a builder to create aResourceDiffinstance between 2 resources.
-
Method Details
-
of
public static <T extends IExtendedResource> ResourceDiff.ResourceDiffBuilder<T> of(T original, T updated) Instantiates a builder to create aResourceDiffinstance between 2 resources.- Type Parameters:
T- the type of resources to compare- Parameters:
original- the original resourceupdated- the updated resource- Returns:
- a builder to create a resource diff
-
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
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
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()Returnstrueif 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
-