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
ConstructorDescriptionDeltaSetTripleImpl
(@NotNull Collection<T> zeroSet, @NotNull Collection<T> plusSet, @NotNull Collection<T> minusSet) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAllToMinusSet
(Collection<T> items) void
addAllToPlusSet
(Collection<T> items) void
addAllToSet
(PlusMinusZero destination, Collection<T> items) void
addAllToZeroSet
(Collection<T> items) void
addToMinusSet
(T item) void
addToPlusSet
(T item) void
addToSet
(PlusMinusZero destination, T item) void
addToZeroSet
(T item) void
void
void
protected void
copyValues
(DeltaSetTripleImpl<T> clone, Cloner<T> cloner) debugDump
(int indent) void
debugDumpSets
(StringBuilder sb, Consumer<T> dumper, int indent) protected String
static <T> DeltaSetTriple<T>
diff
(Collection<T> valuesOld, Collection<T> valuesNew) Compares two (unordered) collections and creates a triple describing the differences.void
Process each element of every set.@NotNull Collection<T>
@NotNull Collection<T>
@NotNull Collection<T>
@NotNull Collection<T>
getSet
(PlusMinusZero whichSet) @NotNull Collection<T>
boolean
boolean
boolean
boolean
isEmpty()
boolean
void
merge
(DeltaSetTriple<T> triple) boolean
presentInMinusSet
(T item) boolean
presentInPlusSet
(T item) protected boolean
presentInSet
(Collection<T> set, T item) boolean
presentInZeroSet
(T item) void
Show the content of the object intended for diagnostics.void
simpleAccept
(SimpleVisitor<T> visitor) int
size()
stream()
protected void
toHumanReadableString
(StringBuilder sb, T item) toString()
<X> void
transform
(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, wait
Methods inherited from interface com.evolveum.midpoint.util.DebugDumpable
debugDump, debugDumpLazily, debugDumpLazily
Methods inherited from interface com.evolveum.midpoint.prism.delta.DeltaSetTriple
clear
Methods 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:
getZeroSet
in interfaceDeltaSetTriple<T>
-
getPlusSet
- Specified by:
getPlusSet
in interfaceDeltaSetTriple<T>
-
getMinusSet
- Specified by:
getMinusSet
in interfaceDeltaSetTriple<T>
-
hasPlusSet
public boolean hasPlusSet()- Specified by:
hasPlusSet
in interfaceDeltaSetTriple<T>
-
hasZeroSet
public boolean hasZeroSet()- Specified by:
hasZeroSet
in interfaceDeltaSetTriple<T>
-
hasMinusSet
public boolean hasMinusSet()- Specified by:
hasMinusSet
in interfaceDeltaSetTriple<T>
-
isZeroOnly
public boolean isZeroOnly()- Specified by:
isZeroOnly
in interfaceDeltaSetTriple<T>
-
addToPlusSet
- Specified by:
addToPlusSet
in interfaceDeltaSetTriple<T>
-
addToMinusSet
- Specified by:
addToMinusSet
in interfaceDeltaSetTriple<T>
-
addToZeroSet
- Specified by:
addToZeroSet
in interfaceDeltaSetTriple<T>
-
addAllToPlusSet
- Specified by:
addAllToPlusSet
in interfaceDeltaSetTriple<T>
-
addAllToMinusSet
- Specified by:
addAllToMinusSet
in interfaceDeltaSetTriple<T>
-
addAllToZeroSet
- Specified by:
addAllToZeroSet
in interfaceDeltaSetTriple<T>
-
getSet
- Specified by:
getSet
in interfaceDeltaSetTriple<T>
-
addAllToSet
- Specified by:
addAllToSet
in interfaceDeltaSetTriple<T>
-
addToSet
- Specified by:
addToSet
in interfaceDeltaSetTriple<T>
-
presentInPlusSet
- Specified by:
presentInPlusSet
in interfaceDeltaSetTriple<T>
-
presentInMinusSet
- Specified by:
presentInMinusSet
in interfaceDeltaSetTriple<T>
-
presentInZeroSet
- Specified by:
presentInZeroSet
in interfaceDeltaSetTriple<T>
-
presentInSet
-
clearPlusSet
public void clearPlusSet()- Specified by:
clearPlusSet
in interfaceDeltaSetTriple<T>
-
clearMinusSet
public void clearMinusSet()- Specified by:
clearMinusSet
in interfaceDeltaSetTriple<T>
-
clearZeroSet
public void clearZeroSet()- Specified by:
clearZeroSet
in interfaceDeltaSetTriple<T>
-
size
public int size()- Specified by:
size
in interfaceDeltaSetTriple<T>
-
union
Returns all values, regardless of the internal sets.- Specified by:
union
in interfaceDeltaSetTriple<T>
-
getAnyValue
- Specified by:
getAnyValue
in interfaceDeltaSetTriple<T>
-
getAllValues
- Specified by:
getAllValues
in interfaceDeltaSetTriple<T>
-
stream
- Specified by:
stream
in interfaceDeltaSetTriple<T>
-
getNonNegativeValues
- Specified by:
getNonNegativeValues
in interfaceDeltaSetTriple<T>
-
getNonPositiveValues
- Specified by:
getNonPositiveValues
in interfaceDeltaSetTriple<T>
-
merge
- Specified by:
merge
in interfaceDeltaSetTriple<T>
-
clone
- Specified by:
clone
in interfaceDeltaSetTriple<T>
-
copyValues
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in 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:
foreach
in interfaceDeltaSetTriple<T>
- Specified by:
foreach
in interfaceForeachable<T>
-
simpleAccept
- Specified by:
simpleAccept
in interfaceDeltaSetTriple<T>
- Specified by:
simpleAccept
in interfaceSimpleVisitable<T>
-
transform
- Specified by:
transform
in interfaceDeltaSetTriple<T>
-
toString
-
debugName
-
debugDump
- Specified by:
debugDump
in interfaceDebugDumpable
-
debugDumpSets
- Specified by:
debugDumpSets
in interfaceDeltaSetTriple<T>
-
shortDump
Description copied from interface:ShortDumpable
Show 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:
shortDump
in 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:
toHumanReadableString
in interfaceDeltaSetTriple<T>
-
toHumanReadableString
-