com.evolveum.midpoint.schema.delta
Class DeltaSetTriple<T>

java.lang.Object
  extended by com.evolveum.midpoint.schema.delta.DeltaSetTriple<T>
All Implemented Interfaces:
Dumpable

public class DeltaSetTriple<T>
extends java.lang.Object
implements Dumpable

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

Constructor Summary
DeltaSetTriple()
           
DeltaSetTriple(java.util.Collection<PropertyValue<T>> zeroSet, java.util.Collection<PropertyValue<T>> plusSet, java.util.Collection<PropertyValue<T>> minusSet)
           
 
Method Summary
static
<T> DeltaSetTriple<T>
diff(java.util.Collection<PropertyValue<T>> valuesOld, java.util.Collection<PropertyValue<T>> valuesNew)
          Compares two (unordered) collections and creates a triple describing the differences.
<O> void
distributeAs(PropertyValue<T> myMember, DeltaSetTriple<O> otherTriple, PropertyValue<O> otherMember)
          Distributes a value in this triple similar to the placement of other value in the other triple.
 java.lang.String dump()
          Show the content of the object intended for diagnostics by developer.
 java.util.Collection<PropertyValue<T>> getMinusSet()
           
 java.util.Collection<PropertyValue<T>> getNonNegativeValues()
           
 java.util.Collection<PropertyValue<T>> getPlusSet()
           
 java.util.Collection<PropertyValue<T>> getZeroSet()
           
 void merge(DeltaSetTriple<T> triple)
           
 java.lang.String toString()
           
 java.util.Collection<PropertyValue<T>> 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
 

Constructor Detail

DeltaSetTriple

public DeltaSetTriple()

DeltaSetTriple

public DeltaSetTriple(java.util.Collection<PropertyValue<T>> zeroSet,
                      java.util.Collection<PropertyValue<T>> plusSet,
                      java.util.Collection<PropertyValue<T>> minusSet)
Method Detail

diff

public static <T> DeltaSetTriple<T> diff(java.util.Collection<PropertyValue<T>> valuesOld,
                                         java.util.Collection<PropertyValue<T>> valuesNew)
Compares two (unordered) collections and creates a triple describing the differences.


getZeroSet

public java.util.Collection<PropertyValue<T>> getZeroSet()

getPlusSet

public java.util.Collection<PropertyValue<T>> getPlusSet()

getMinusSet

public java.util.Collection<PropertyValue<T>> getMinusSet()

union

public java.util.Collection<PropertyValue<T>> union()
Returns all values, regardless of the internal sets.


getNonNegativeValues

public java.util.Collection<PropertyValue<T>> getNonNegativeValues()

distributeAs

public <O> void distributeAs(PropertyValue<T> myMember,
                             DeltaSetTriple<O> otherTriple,
                             PropertyValue<O> otherMember)
Distributes a value in this triple similar to the placement of other value in the other triple. E.g. if the value "otherMember" is in the zero set in "otherTriple" then "myMember" will be placed in zero set in this triple.


merge

public void merge(DeltaSetTriple<T> triple)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

dump

public java.lang.String dump()
Description copied from interface: Dumpable
Show the content of the object intended for diagnostics by developer. The content may be multi-line, in case of hierarchical objects it may be intended. The use of this method may not be efficient. It is not supposed to be used in normal operation. However, it is very useful in tests or in case of dumping objects in severe error situations.

Specified by:
dump in interface Dumpable
Returns:
content of the object intended for diagnostics.


Copyright © 2012 evolveum. All Rights Reserved.