Class DeltaSetTripleImpl<T>
java.lang.Object
com.evolveum.midpoint.prism.impl.delta.DeltaSetTripleImpl<T>
- All Implemented Interfaces:
DeltaSetTriple<T>,SimpleVisitable<T>,DebugDumpable,Foreachable<T>,ShortDumpable,Serializable
- Direct Known Subclasses:
PrismValueDeltaSetTripleImpl
The triple of values (added, unchanged, deleted) that represents difference between two collections of values.
The DeltaSetTriple is used as a result of a "diff" operation or it is constructed to determine a ObjectDelta or PropertyDelta. It is a very useful structure in numerous situations when dealing with relative changes.
DeltaSetTriple (similarly to other parts of this system) deal only with unordered values.
- Author:
- Radovan Semancik
- See Also:
-
Field Summary
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING -
Constructor Summary
ConstructorsConstructorDescriptionDeltaSetTripleImpl(@NotNull Collection<T> zeroSet, @NotNull Collection<T> plusSet, @NotNull Collection<T> minusSet) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAllToMinusSet(Collection<T> items) voidaddAllToPlusSet(Collection<T> items) voidaddAllToSet(PlusMinusZero destination, Collection<T> items) voidaddAllToZeroSet(Collection<T> items) voidaddToMinusSet(T item) voidaddToPlusSet(T item) voidaddToSet(PlusMinusZero destination, T item) voidaddToZeroSet(T item) voidvoidvoidprotected voidcopyValues(DeltaSetTripleImpl<T> clone, Cloner<T> cloner) debugDump(int indent) voiddebugDumpSets(StringBuilder sb, Consumer<T> dumper, int indent) protected Stringstatic <T> DeltaSetTriple<T>diff(Collection<T> valuesOld, Collection<T> valuesNew) Compares two (unordered) collections and creates a triple describing the differences.voidProcess each element of every set.@NotNull Collection<T>@NotNull Collection<T>@NotNull Collection<T>@NotNull Collection<T>getSet(PlusMinusZero whichSet) @NotNull Collection<T>booleanbooleanbooleanbooleanisEmpty()booleanvoidmerge(DeltaSetTriple<T> triple) booleanpresentInMinusSet(T item) booleanpresentInPlusSet(T item) protected booleanpresentInSet(Collection<T> set, T item) booleanpresentInZeroSet(T item) voidShow the content of the object intended for diagnostics.voidsimpleAccept(SimpleVisitor<T> visitor) intsize()stream()protected voidtoHumanReadableString(StringBuilder sb, T item) toString()<X> voidtransform(DeltaSetTriple<X> transformTarget, Transformer<T, X> transformer) union()Returns all values, regardless of the internal sets.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.evolveum.midpoint.util.DebugDumpable
debugDump, debugDumpLazily, debugDumpLazilyMethods inherited from interface com.evolveum.midpoint.prism.delta.DeltaSetTriple
clearMethods inherited from interface com.evolveum.midpoint.util.ShortDumpable
shortDump, shortDumpLazily
-
Constructor Details
-
DeltaSetTripleImpl
public DeltaSetTripleImpl() -
DeltaSetTripleImpl
public DeltaSetTripleImpl(@NotNull @NotNull Collection<T> zeroSet, @NotNull @NotNull Collection<T> plusSet, @NotNull @NotNull Collection<T> minusSet)
-
-
Method Details
-
diff
Compares two (unordered) collections and creates a triple describing the differences. -
getZeroSet
- Specified by:
getZeroSetin interfaceDeltaSetTriple<T>
-
getPlusSet
- Specified by:
getPlusSetin interfaceDeltaSetTriple<T>
-
getMinusSet
- Specified by:
getMinusSetin interfaceDeltaSetTriple<T>
-
hasPlusSet
public boolean hasPlusSet()- Specified by:
hasPlusSetin interfaceDeltaSetTriple<T>
-
hasZeroSet
public boolean hasZeroSet()- Specified by:
hasZeroSetin interfaceDeltaSetTriple<T>
-
hasMinusSet
public boolean hasMinusSet()- Specified by:
hasMinusSetin interfaceDeltaSetTriple<T>
-
isZeroOnly
public boolean isZeroOnly()- Specified by:
isZeroOnlyin interfaceDeltaSetTriple<T>
-
addToPlusSet
- Specified by:
addToPlusSetin interfaceDeltaSetTriple<T>
-
addToMinusSet
- Specified by:
addToMinusSetin interfaceDeltaSetTriple<T>
-
addToZeroSet
- Specified by:
addToZeroSetin interfaceDeltaSetTriple<T>
-
addAllToPlusSet
- Specified by:
addAllToPlusSetin interfaceDeltaSetTriple<T>
-
addAllToMinusSet
- Specified by:
addAllToMinusSetin interfaceDeltaSetTriple<T>
-
addAllToZeroSet
- Specified by:
addAllToZeroSetin interfaceDeltaSetTriple<T>
-
getSet
- Specified by:
getSetin interfaceDeltaSetTriple<T>
-
addAllToSet
- Specified by:
addAllToSetin interfaceDeltaSetTriple<T>
-
addToSet
- Specified by:
addToSetin interfaceDeltaSetTriple<T>
-
presentInPlusSet
- Specified by:
presentInPlusSetin interfaceDeltaSetTriple<T>
-
presentInMinusSet
- Specified by:
presentInMinusSetin interfaceDeltaSetTriple<T>
-
presentInZeroSet
- Specified by:
presentInZeroSetin interfaceDeltaSetTriple<T>
-
presentInSet
-
clearPlusSet
public void clearPlusSet()- Specified by:
clearPlusSetin interfaceDeltaSetTriple<T>
-
clearMinusSet
public void clearMinusSet()- Specified by:
clearMinusSetin interfaceDeltaSetTriple<T>
-
clearZeroSet
public void clearZeroSet()- Specified by:
clearZeroSetin interfaceDeltaSetTriple<T>
-
size
public int size()- Specified by:
sizein interfaceDeltaSetTriple<T>
-
union
Returns all values, regardless of the internal sets.- Specified by:
unionin interfaceDeltaSetTriple<T>
-
getAnyValue
- Specified by:
getAnyValuein interfaceDeltaSetTriple<T>
-
getAllValues
- Specified by:
getAllValuesin interfaceDeltaSetTriple<T>
-
stream
- Specified by:
streamin interfaceDeltaSetTriple<T>
-
getNonNegativeValues
- Specified by:
getNonNegativeValuesin interfaceDeltaSetTriple<T>
-
getNonPositiveValues
- Specified by:
getNonPositiveValuesin interfaceDeltaSetTriple<T>
-
merge
- Specified by:
mergein interfaceDeltaSetTriple<T>
-
clone
- Specified by:
clonein interfaceDeltaSetTriple<T>
-
copyValues
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceDeltaSetTriple<T>
-
foreach
Process each element of every set. This is different from the visitor. Visitor will go deep inside, foreach will remain on the surface.- Specified by:
foreachin interfaceDeltaSetTriple<T>- Specified by:
foreachin interfaceForeachable<T>
-
simpleAccept
- Specified by:
simpleAcceptin interfaceDeltaSetTriple<T>- Specified by:
simpleAcceptin interfaceSimpleVisitable<T>
-
transform
- Specified by:
transformin interfaceDeltaSetTriple<T>
-
toString
-
debugName
-
debugDump
- Specified by:
debugDumpin interfaceDebugDumpable
-
debugDumpSets
- Specified by:
debugDumpSetsin interfaceDeltaSetTriple<T>
-
shortDump
Description copied from interface:ShortDumpableShow the content of the object intended for diagnostics. This method is supposed to append a compact, human-readable output in a single line. Unlike toString() method, there is no requirement to identify the actual class or type of the object. It is assumed that the class/type will be obvious from the context in which the output is used.- Specified by:
shortDumpin interfaceShortDumpable- Parameters:
sb- StringBuilder to which to a compact one-line content of the object intended for diagnostics by system administrator should be appended.
-
toHumanReadableString
- Specified by:
toHumanReadableStringin interfaceDeltaSetTriple<T>
-
toHumanReadableString
-