Search in sources :

Example 1 with OutcomeKeyedCounterType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.OutcomeKeyedCounterType in project midpoint by Evolveum.

the class OutcomeKeyedCounterTypeUtil method incrementCounter.

/**
 * Increments counter corresponding to given outcome.
 */
public static int incrementCounter(List<OutcomeKeyedCounterType> counters, QualifiedItemProcessingOutcomeType outcome, PrismContext prismContext) {
    OutcomeKeyedCounterType counter = findOrCreateCounter(counters, outcome, prismContext);
    counter.setCount(or0(counter.getCount()) + 1);
    return counter.getCount();
}
Also used : OutcomeKeyedCounterType(com.evolveum.midpoint.xml.ns._public.common.common_3.OutcomeKeyedCounterType)

Example 2 with OutcomeKeyedCounterType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.OutcomeKeyedCounterType in project midpoint by Evolveum.

the class OutcomeKeyedCounterTypeUtil method addCounters.

/**
 * Adds two lists of counters: finds matching pairs and adds them.
 */
public static void addCounters(List<OutcomeKeyedCounterType> sumCounters, List<OutcomeKeyedCounterType> deltaCounters) {
    for (OutcomeKeyedCounterType deltaCounter : deltaCounters) {
        OutcomeKeyedCounterType matchingCounter = findOrCreateCounter(sumCounters, deltaCounter.getOutcome(), null);
        addMatchingCounters(matchingCounter, deltaCounter);
    }
}
Also used : OutcomeKeyedCounterType(com.evolveum.midpoint.xml.ns._public.common.common_3.OutcomeKeyedCounterType)

Aggregations

OutcomeKeyedCounterType (com.evolveum.midpoint.xml.ns._public.common.common_3.OutcomeKeyedCounterType)2