/** * Compares two (unordered) collections and creates a triple describing the differences. */ public static <T> DeltaSetTriple<T> diff(Collection<T> valuesOld, Collection<T> valuesNew) { DeltaSetTriple<T> triple = new DeltaSetTripleImpl<>(); DeltaSetTripleUtil.diff(valuesOld, valuesNew, triple); return triple; }
private PrismValueDeltaSetTriple<V> evaluateAbsoluteExpression(Collection<Source<?,?>> sources, ExpressionVariables variables, ExpressionEvaluationContext params, String contextDescription, Task task, OperationResult result) throws ExpressionEvaluationException, ObjectNotFoundException, SchemaException, CommunicationException, ConfigurationException, SecurityViolationException { PrismValueDeltaSetTriple<V> outputTriple; if (hasDeltas(sources) || hasDeltas(variables)) { Collection<V> outputSetOld = null; if (!params.isSkipEvaluationMinus()) { outputSetOld = evaluateScriptExpression(sources, variables, contextDescription, false, params, task, result); } Collection<V> outputSetNew = null; if (!params.isSkipEvaluationPlus()) { outputSetNew = evaluateScriptExpression(sources, variables, contextDescription, true, params, task, result); } outputTriple = DeltaSetTripleUtil.diffPrismValueDeltaSetTriple(outputSetOld, outputSetNew, prismContext); } else { // No need to execute twice. There is no change. Collection<V> outputSetNew = evaluateScriptExpression(sources, variables, contextDescription, true, params, task, result); outputTriple = prismContext.deltaFactory().createPrismValueDeltaSetTriple(); outputTriple.addAllToZeroSet(outputSetNew); } return outputTriple; }
continue; DeltaSetTriple<? extends ItemValueWithOrigin<?, ?>> triple = DeltaSetTripleUtil.find(outputTripleMap, path); if (triple == null) { continue;
/** * Compares two (unordered) collections and creates a triple describing the differences. */ public static <V extends PrismValue> PrismValueDeltaSetTriple<V> diffPrismValueDeltaSetTriple(Collection<V> valuesOld, Collection<V> valuesNew, PrismContext prismContext) { PrismValueDeltaSetTriple<V> triple = prismContext.deltaFactory().createPrismValueDeltaSetTriple(); diff(valuesOld, valuesNew, triple); return triple; }
/** * Compares two (unordered) collections and creates a triple describing the differences. */ static <T> DeltaSetTriple<T> diff(Collection<T> valuesOld, Collection<T> valuesNew, PrismContext prismContext) { DeltaSetTriple<T> triple = prismContext.deltaFactory().createDeltaSetTriple(); DeltaSetTripleUtil.diff(valuesOld, valuesNew, triple); return triple; }