Package org.togglz.mongodb
Class MongoStateRepository.Builder
- java.lang.Object
-
- org.togglz.mongodb.MongoStateRepository.Builder
-
- Enclosing class:
- MongoStateRepository
public static class MongoStateRepository.Builder extends Object
Builder for aMongoStateRepository.
-
-
Constructor Summary
Constructors Constructor Description Builder(com.mongodb.client.MongoClient client, String dbname)Creates a new builder for aMongoStateRepository.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MongoStateRepositorybuild()Creates a newMongoStateRepositoryusing the current settings.MongoStateRepository.Buildercollection(String collection)The name of the collection used by the repository to store the feature state.MongoStateRepository.BuilderwriteConcern(com.mongodb.WriteConcern writeConcern)TheWriteConcernused when accessing the database.
-
-
-
Constructor Detail
-
Builder
public Builder(com.mongodb.client.MongoClient client, String dbname)Creates a new builder for aMongoStateRepository.- Parameters:
client- the client instance to use for connecting to MongoDBdbname- the database name used for storing features state.
-
-
Method Detail
-
collection
public MongoStateRepository.Builder collection(String collection)
The name of the collection used by the repository to store the feature state. The default istogglz.- Parameters:
collection- The name of the collection to use
-
writeConcern
public MongoStateRepository.Builder writeConcern(com.mongodb.WriteConcern writeConcern)
TheWriteConcernused when accessing the database. By defaultACKNOWLEDGEDwill be used.- Parameters:
writeConcern- TheWriteConcernto use
-
build
public MongoStateRepository build()
Creates a newMongoStateRepositoryusing the current settings.
-
-