Package net.solarnetwork.domain
Interface Differentiable<T>
- All Known Subinterfaces:
DatumMetadataOperations,DatumSamplesOperations,MutableDatumMetadataOperations,MutableDatumSamplesOperations
- All Known Implementing Classes:
DatumSamples,GeneralDatum,GeneralDatumMetadata,MapSampleOperations
public interface Differentiable<T>
Common API for an object that can be compared to another for differences.
The actual meaning of different is implementation specific. For example an entity might implement this API in order to tell if a modified copy of an entity with the same identity as a persisted instance have different property values, and thus the copy should be persisted to save the updated property values.
- Since:
- 1.59
- Version:
- 1.1
- Author:
- matt
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends Differentiable<T>>
booleandiffer(Collection<T> l, Collection<T> r) Test if two collections ofDifferentiableobjects have any difference.static <T extends Differentiable<T>>
booleandiffer(T l, T r) Test if twoDifferentiableobjects differ.booleandiffersFrom(T other) Test if this object differs from another.
-
Method Details
-
differsFrom
Test if this object differs from another.- Parameters:
other- the other object to compare to- Returns:
- true if the object differs from this object
-
differ
Test if twoDifferentiableobjects differ.If both objects are null this method returns false. If one object is null this methdo returns true. Otherwise this method returns the result of
l.differsFrom(r).- Type Parameters:
T- the Differentiable type- Parameters:
l- the first objectr- the second object- Returns:
- true if there are any difference between the objects
- Since:
- 1.1
-
differ
Test if two collections ofDifferentiableobjects have any difference.This compares the objects in each collection in iteration order. If any pair of objects differ, this method returns true. If the collections are of different sizes, this method returns true. If both collections are null this method returns false.
- Type Parameters:
T- the Differentiable type- Parameters:
l- the first collectionr- the second collection- Returns:
- true if there are any differences between the collections
- Since:
- 1.1
-