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

org.minijax.jndi.MinijaxBindingsEnumeration Maven / Gradle / Ivy

There is a newer version: 0.5.10
Show newest version
package org.minijax.jndi;

import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;

import javax.naming.Binding;
import javax.naming.NamingEnumeration;

public class MinijaxBindingsEnumeration implements NamingEnumeration {
    private final Iterator> iterator;

    public MinijaxBindingsEnumeration(final Map data) {
        this.iterator = data.entrySet().iterator();
    }

    @Override
    @SuppressWarnings("unchecked")
    public Binding next() {
        final Entry entry = iterator.next();
        return new Binding(entry.getKey().toString(), entry.getValue());
    }

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

    @Override
    public void close() {
        // Nothing to do
    }

    @Override
    public Binding nextElement() {
        throw new UnsupportedOperationException();
    }

    @Override
    public boolean hasMoreElements() {
        throw new UnsupportedOperationException();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy