Class ImmutableMongoDbConfig.Builder
- java.lang.Object
-
- io.resys.hdes.object.repo.mongodb.ImmutableMongoDbConfig.Builder
-
- Enclosing class:
- ImmutableMongoDbConfig
@NotThreadSafe public static final class ImmutableMongoDbConfig.Builder extends Object
Builds instances of typeImmutableMongoDbConfig. Initialize attributes and then invoke thebuild()method to create an immutable instance.Builderis not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ImmutableMongoDbConfigbuild()Builds a newImmutableMongoDbConfig.ImmutableMongoDbConfig.Builderdb(String db)Initializes the value for thedbattribute.ImmutableMongoDbConfig.Builderfrom(MongoCommand.MongoDbConfig instance)Fill a builder with attribute values from the providedMongoDbConfiginstance.ImmutableMongoDbConfig.Builderobjects(String objects)Initializes the value for theobjectsattribute.ImmutableMongoDbConfig.Builderrefs(String refs)Initializes the value for therefsattribute.ImmutableMongoDbConfig.Buildertags(String tags)Initializes the value for thetagsattribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableMongoDbConfig.Builder from(MongoCommand.MongoDbConfig instance)
Fill a builder with attribute values from the providedMongoDbConfiginstance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
db
@CanIgnoreReturnValue public final ImmutableMongoDbConfig.Builder db(String db)
Initializes the value for thedbattribute.- Parameters:
db- The value for db- Returns:
thisbuilder for use in a chained invocation
-
refs
@CanIgnoreReturnValue public final ImmutableMongoDbConfig.Builder refs(String refs)
Initializes the value for therefsattribute.- Parameters:
refs- The value for refs- Returns:
thisbuilder for use in a chained invocation
-
tags
@CanIgnoreReturnValue public final ImmutableMongoDbConfig.Builder tags(String tags)
Initializes the value for thetagsattribute.- Parameters:
tags- The value for tags- Returns:
thisbuilder for use in a chained invocation
-
objects
@CanIgnoreReturnValue public final ImmutableMongoDbConfig.Builder objects(String objects)
Initializes the value for theobjectsattribute.- Parameters:
objects- The value for objects- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableMongoDbConfig build()
Builds a newImmutableMongoDbConfig.- Returns:
- An immutable instance of MongoDbConfig
- Throws:
IllegalStateException- if any required attributes are missing
-
-