+ public Builder name(final String newName) {
+ this.name = newName;
+ return this;
+ }
+
+ public Builder nameSpace(final String newNameSpace) {
+ this.nameSpace = newNameSpace;
+ return this;
+ }
+
+ public Builder shardStrategy(final ShardStrategy newShardStrategy) {
+ this.shardStrategy = newShardStrategy;
+ return this;
+ }
+
+ public Builder shardConfig(final String shardName, final Collection<MemberName> replicas) {
+ shardConfigs.put(shardName, new ShardConfig(shardName, replicas));
+ return this;
+ }
+
+ public ModuleConfig build() {
+ return new ModuleConfig(Preconditions.checkNotNull(name), nameSpace, shardStrategy,
+ ImmutableMap.copyOf(shardConfigs));
+ }