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

org.postgresql.hostchooser.SingleHostChooser Maven / Gradle / Ivy

There is a newer version: 8.1.2
Show newest version
/*-------------------------------------------------------------------------
*
* Copyright (c) 2014, PostgreSQL Global Development Group
*
*
*-------------------------------------------------------------------------
*/
package org.postgresql.hostchooser;

import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;

import org.postgresql.util.HostSpec;

/**
 * Host chooser that returns the single host.
 */
public class SingleHostChooser implements HostChooser {
    private final Collection hostSpec;

    public SingleHostChooser(HostSpec hostSpec) {
        this.hostSpec = Collections.singletonList(hostSpec);
    }

    public Iterator iterator() {
        return hostSpec.iterator();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy