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

com.lordofthejars.nosqlunit.couchbase.RemoteCouchbaseConfigurationBuilder Maven / Gradle / Ivy

There is a newer version: 1.0.0
Show newest version
package com.lordofthejars.nosqlunit.couchbase;

import java.net.URI;
import java.util.ArrayList;
import java.util.List;

public class RemoteCouchbaseConfigurationBuilder {

    public static class Builder {

        private String name;
        private String password = "";
        private List uris;

        private Builder() {
            uris = new ArrayList();
        }

        public static Builder start() {
            return new Builder();
        }

        public Builder bucketName(final String name) {
            this.name = name;
            return this;
        }

        public Builder bucketPassword(final String pass) {
            password = pass;
            return this;
        }

        public Builder serverUri(final String url) {
            uris.add(URI.create(url));
            return this;
        }

        public CouchbaseConfiguration build() {
            if (uris.isEmpty()) {
                uris.add(URI.create("http://localhost:8091/pools"));
            }
            return new CouchbaseConfiguration(uris, password, name);
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy