Example usage for org.apache.commons.collections4 MultiValuedMap containsValue

List of usage examples for org.apache.commons.collections4 MultiValuedMap containsValue

Introduction

In this page you can find the example usage for org.apache.commons.collections4 MultiValuedMap containsValue.

Prototype

boolean containsValue(Object value);

Source Link

Document

Checks whether the map contains at least one mapping for the specified value.

Usage

From source file:com.evolveum.midpoint.task.quartzimpl.work.workers.WorkersManager.java

/**
 * The easiest step: we just match current workers with the 'should be' state. Matching items are deleted from both sides.
 *///  w w w .j  a va 2  s  .c  o m
private int matchWorkers(List<Task> currentWorkers, MultiValuedMap<String, WorkerKey> shouldBeWorkers) {
    int count = 0;
    for (Task currentWorker : new ArrayList<>(currentWorkers)) {
        WorkerKey currentWorkerKey = new WorkerKey(currentWorker);
        if (shouldBeWorkers.containsValue(currentWorkerKey)) {
            shouldBeWorkers.removeMapping(currentWorkerKey.group, currentWorkerKey);
            currentWorkers.remove(currentWorker);
            count++;
        }
    }
    LOGGER.trace("After matchWorkers (result: {}):\nCurrent workers: {}\nShould be workers: {}", count,
            currentWorkers, shouldBeWorkers);
    return count;
}