org.infinispan.stream.impl.RemovableIterator Maven / Gradle / Ivy
package org.infinispan.stream.impl;
import java.util.Iterator;
import java.util.function.Function;
import org.infinispan.Cache;
/**
* An Iterator implementation that allows for a Iterator that doesn't allow remove operations to
* implement remove by delegating the call to the provided cache to remove the previously read value. The key used
* to remove from the cache is determined by first applying the removeFunction to the value retrieved from the
* iterator.
*
* @author wburns
* @since 8.0
* @deprecated Users should use {@link org.infinispan.commons.util.RemovableIterator} instead
*/
public class RemovableIterator extends org.infinispan.commons.util.RemovableIterator {
public RemovableIterator(Iterator realIterator, Cache cache,
Function super C, K> removeFunction) {
super(realIterator, c -> cache.remove(removeFunction.apply(c)));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy