Class PatternComponentBuilder

java.lang.Object
com.commercetools.history.models.cart_discount.PatternComponentBuilder
All Implemented Interfaces:
Builder<PatternComponent>

public class PatternComponentBuilder extends Object implements Builder<PatternComponent>
PatternComponentBuilder
Example to create an instance using the builder pattern

     PatternComponent patternComponent = PatternComponent.builder()
             .type("{type}")
             .build()
 
  • Constructor Details

    • PatternComponentBuilder

      public PatternComponentBuilder()
  • Method Details

    • type

      public PatternComponentBuilder type(String type)
      set the value to the type
      Parameters:
      type - value to be set
      Returns:
      Builder
    • getType

      public String getType()
      value of type}
      Returns:
      type
    • build

      public PatternComponent build()
      builds PatternComponent with checking for non-null required values
      Specified by:
      build in interface Builder<PatternComponent>
      Returns:
      PatternComponent
    • buildUnchecked

      public PatternComponent buildUnchecked()
      builds PatternComponent without checking for non-null required values
      Returns:
      PatternComponent
    • of

      public static PatternComponentBuilder of()
      factory method for an instance of PatternComponentBuilder
      Returns:
      builder
    • of

      public static PatternComponentBuilder of(PatternComponent template)
      create builder for PatternComponent instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder