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

io.quarkus.resteasy.reactive.server.servlet.runtime.EnumerationIterable Maven / Gradle / Ivy

The newest version!
package io.quarkus.resteasy.reactive.server.servlet.runtime;

import java.util.Enumeration;
import java.util.Iterator;

/**
 * Single shot wrapper for an enum that allows it to be used in for-each loops
 *
 * @param 
 */
public class EnumerationIterable implements Iterable, Iterator {
    private final Enumeration enumeration;

    public EnumerationIterable(Enumeration enumeration) {
        this.enumeration = enumeration;
    }

    @Override
    public Iterator iterator() {
        return this;
    }

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

    @Override
    public T next() {
        return enumeration.nextElement();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy