Interface ToCopyableBuilder<B extends CopyableBuilder<B,T>,T extends ToCopyableBuilder<B,T>>
-
- Type Parameters:
T- the type that the builder will build (this)B- the builder type
- All Known Implementing Classes:
AttributeMap,RefreshResult
public interface ToCopyableBuilder<B extends CopyableBuilder<B,T>,T extends ToCopyableBuilder<B,T>>Implementors of this interface provide a way to get from an instance of T to aCopyableBuilder. This allows modification of an otherwise immutable object using the source object as a base.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default Tcopy(Consumer<? super B> modifier)A convenience method for callingtoBuilder(), updating the returned builder and then callingSdkBuilder.build().BtoBuilder()Take this object and create a builder that contains all of the current property values of this object.
-
-
-
Method Detail
-
toBuilder
B toBuilder()
Take this object and create a builder that contains all of the current property values of this object.- Returns:
- a builder for type T
-
copy
default T copy(Consumer<? super B> modifier)
A convenience method for callingtoBuilder(), updating the returned builder and then callingSdkBuilder.build(). This is useful for making small modifications to the existing object.- Parameters:
modifier- A function that mutates this immutable object using the provided builder.- Returns:
- A new copy of this object with the requested modifications.
-
-