public class DeltaSetTriple<T> extends Object implements DebugDumpable, ShortDumpable, Serializable, SimpleVisitable<T>, Foreachable<T>
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.
INDENT_STRING
Constructor and Description |
---|
DeltaSetTriple() |
DeltaSetTriple(Collection<T> zeroSet,
Collection<T> plusSet,
Collection<T> minusSet) |
Modifier and Type | Method and Description |
---|---|
void |
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 |
clearMinusSet() |
void |
clearPlusSet() |
void |
clearZeroSet() |
DeltaSetTriple<T> |
clone(Cloner<T> cloner) |
protected void |
copyValues(DeltaSetTriple<T> clone,
Cloner<T> cloner) |
String |
debugDump()
Show the content of the object intended for diagnostics by system administrator.
|
String |
debugDump(int indent) |
void |
debugDumpSets(StringBuilder sb,
Consumer<T> dumper,
int indent) |
protected String |
debugName() |
static <T> DeltaSetTriple<T> |
diff(Collection<T> valuesOld,
Collection<T> valuesNew)
Compares two (unordered) collections and creates a triple describing the differences.
|
protected static <T> void |
diff(Collection<T> valuesOld,
Collection<T> valuesNew,
DeltaSetTriple<T> triple) |
static <T> DeltaSetTriple<? extends T> |
find(Map<ItemPath,DeltaSetTriple<? extends T>> tripleMap,
ItemPath path) |
void |
foreach(Processor<T> processor)
Process each element of every set.
|
Collection<T> |
getAllValues() |
T |
getAnyValue() |
Collection<T> |
getMinusSet() |
Collection<T> |
getNonNegativeValues() |
Collection<T> |
getNonPositiveValues() |
Collection<T> |
getPlusSet() |
Collection<T> |
getSet(PlusMinusZero whichSet) |
Collection<T> |
getZeroSet() |
boolean |
hasMinusSet() |
boolean |
hasPlusSet() |
boolean |
hasZeroSet() |
boolean |
isEmpty() |
boolean |
isZeroOnly() |
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 |
shortDump(StringBuilder sb)
Show the content of the object intended for diagnostics.
|
void |
simpleAccept(SimpleVisitor<T> visitor) |
int |
size() |
Stream<T> |
stream() |
String |
toHumanReadableString() |
protected void |
toHumanReadableString(StringBuilder sb,
T item) |
String |
toString() |
<X> void |
transform(DeltaSetTriple<X> transformTarget,
Transformer<T,X> transformer) |
Collection<T> |
union()
Returns all values, regardless of the internal sets.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
debugDumpLazily, debugDumpLazily
shortDump, shortDumpLazily
public DeltaSetTriple()
public DeltaSetTriple(@NotNull Collection<T> zeroSet, @NotNull Collection<T> plusSet, @NotNull Collection<T> minusSet)
public static <T> DeltaSetTriple<T> diff(Collection<T> valuesOld, Collection<T> valuesNew)
protected static <T> void diff(Collection<T> valuesOld, Collection<T> valuesNew, DeltaSetTriple<T> triple)
@NotNull public Collection<T> getZeroSet()
@NotNull public Collection<T> getPlusSet()
@NotNull public Collection<T> getMinusSet()
public boolean hasPlusSet()
public boolean hasZeroSet()
public boolean hasMinusSet()
public boolean isZeroOnly()
public void addToPlusSet(T item)
public void addToMinusSet(T item)
public void addToZeroSet(T item)
public void addAllToPlusSet(Collection<T> items)
public void addAllToMinusSet(Collection<T> items)
public void addAllToZeroSet(Collection<T> items)
public Collection<T> getSet(PlusMinusZero whichSet)
public void addAllToSet(PlusMinusZero destination, Collection<T> items)
public void addToSet(PlusMinusZero destination, T item)
public boolean presentInPlusSet(T item)
public boolean presentInMinusSet(T item)
public boolean presentInZeroSet(T item)
protected boolean presentInSet(Collection<T> set, T item)
public void clearPlusSet()
public void clearMinusSet()
public void clearZeroSet()
public int size()
public Collection<T> union()
public T getAnyValue()
public Collection<T> getAllValues()
@NotNull public Collection<T> getNonNegativeValues()
@NotNull public Collection<T> getNonPositiveValues()
public void merge(DeltaSetTriple<T> triple)
public DeltaSetTriple<T> clone(Cloner<T> cloner)
protected void copyValues(DeltaSetTriple<T> clone, Cloner<T> cloner)
public boolean isEmpty()
public void foreach(Processor<T> processor)
foreach
in interface Foreachable<T>
public void simpleAccept(SimpleVisitor<T> visitor)
simpleAccept
in interface SimpleVisitable<T>
public <X> void transform(DeltaSetTriple<X> transformTarget, Transformer<T,X> transformer)
protected String debugName()
public String debugDump()
DebugDumpable
debugDump
in interface DebugDumpable
public String debugDump(int indent)
debugDump
in interface DebugDumpable
public void debugDumpSets(StringBuilder sb, Consumer<T> dumper, int indent)
public void shortDump(StringBuilder sb)
ShortDumpable
shortDump
in interface ShortDumpable
sb
- StringBuilder to which to a compact one-line content of the object intended
for diagnostics by system administrator should be appended.public String toHumanReadableString()
protected void toHumanReadableString(StringBuilder sb, T item)
public static <T> DeltaSetTriple<? extends T> find(Map<ItemPath,DeltaSetTriple<? extends T>> tripleMap, ItemPath path)
Copyright © 2019 Evolveum. All rights reserved.