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 a CopyableBuilder. This allows modification of an otherwise immutable object using the source object as a base.
    • 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 calling toBuilder(), updating the returned builder and then calling SdkBuilder.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.