Interface SdkBuilder<B extends SdkBuilder<B,​T>,​T>

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default B applyMutation​(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.
      T build()
      An immutable object that is created from the properties that have been set on the builder.
    • Method Detail

      • build

        T build()
        An immutable object that is created from the properties that have been set on the builder.
        Specified by:
        build in interface Buildable
        Returns:
        an instance of T
      • applyMutation

        default B applyMutation​(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. 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