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

dev.marksman.enhancediterables.ProtectedIterator Maven / Gradle / Ivy

There is a newer version: 1.2.0
Show newest version
package dev.marksman.enhancediterables;

import java.util.Iterator;

final class ProtectedIterator implements Iterator {
    private final Iterator underlying;

    private ProtectedIterator(Iterator underlying) {
        this.underlying = underlying;
    }

    @Override
    public boolean hasNext() {
        return underlying.hasNext();
    }

    @Override
    public A next() {
        return underlying.next();
    }

    static  ProtectedIterator protectedIterator(Iterator underlying) {
        return new ProtectedIterator<>(underlying);
    }

}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy