Interface SdkBuilder<B extends SdkBuilder<B,T>,T>
- Type Parameters:
B- the builder type (this)T- the type that the builder will build
- All Superinterfaces:
Buildable
- All Known Subinterfaces:
CopyableBuilder<B,T>
- All Known Implementing Classes:
AttributeMap.Builder,RefreshResult.Builder
A mutable object that can be used to create an immutable object of type T.
-
Method Summary
Modifier and TypeMethodDescriptiondefault BapplyMutation(Consumer<B> mutator) A convenience operator that takes something that will mutate the builder in some way and allows inclusion of it in chaining operations.build()An immutable object that is created from the properties that have been set on the builder.
-
Method Details
-
build
T build()An immutable object that is created from the properties that have been set on the builder. -
applyMutation
A convenience operator that takes something that will mutate the builder in some way and allows inclusion of it in chaining operations. For example instead of:Builder builder = ClassBeingBuilt.builder(); builder = Util.addSomeDetailToTheBuilder(builder); ClassBeingBuilt clz = builder.build();This can be done in a statement:
ClassBeingBuilt = ClassBeingBuilt.builder().applyMutation(Util::addSomeDetailToTheBuilder).build();- Parameters:
mutator- the function that mutates the builder- Returns:
- B the mutated builder instance
-