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

com.github.scr.j8iterables.core.SupplierIterable Maven / Gradle / Ivy

There is a newer version: 1.8.0
Show newest version
package com.github.scr.j8iterables.core;

import com.google.common.collect.FluentIterable;

import java.util.Iterator;
import java.util.function.Supplier;

/**
 * Iterable that gets its {@link Iterator} from a {@link Supplier}.
 *
 * @author scr
 */
public class SupplierIterable extends FluentIterable {
    private final Supplier> SUPPLIER;

    public SupplierIterable(Supplier> supplier) {
        SUPPLIER = supplier;
    }

    @Override
    public Iterator iterator() {
        return SUPPLIER.get();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy