All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.infinispan.commons.util.CloseableIteratorMapper Maven / Gradle / Ivy

There is a newer version: 9.1.7.Final
Show newest version
package org.infinispan.commons.util;

import java.util.function.Function;

/**
 * A iterator that maps each value to the output of the Function.  Note that the remove is supported if the iterator
 * originally supported remove.
 * @author William Burns
 * @since 8.0
 */
public class CloseableIteratorMapper extends IteratorMapper implements CloseableIterator {
   private final CloseableIterator iterator;

   public CloseableIteratorMapper(CloseableIterator iterator, Function function) {
      super(iterator, function);
      this.iterator = iterator;
   }

   @Override
   public void close() {
      iterator.close();
   }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy