Class MongoStateRepository.Builder

java.lang.Object
org.togglz.mongodb.MongoStateRepository.Builder
Enclosing class:
MongoStateRepository

public static class MongoStateRepository.Builder extends Object
Builder for a MongoStateRepository.
  • Constructor Details

    • Builder

      public Builder(com.mongodb.client.MongoClient client, String dbname)
      Creates a new builder for a MongoStateRepository.
      Parameters:
      client - the client instance to use for connecting to MongoDB
      dbname - the database name used for storing features state.
  • Method Details

    • collection

      public MongoStateRepository.Builder collection(String collection)
      The name of the collection used by the repository to store the feature state. The default is togglz.
      Parameters:
      collection - The name of the collection to use
    • writeConcern

      public MongoStateRepository.Builder writeConcern(com.mongodb.WriteConcern writeConcern)
      The WriteConcern used when accessing the database. By default ACKNOWLEDGED will be used.
      Parameters:
      writeConcern - The WriteConcern to use
    • build

      public MongoStateRepository build()
      Creates a new MongoStateRepository using the current settings.