java.lang.Object
com.commercetools.importapi.models.customfields.CustomBuilder
All Implemented Interfaces:
Builder<Custom>

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

     Custom custom = Custom.builder()
             .type(typeBuilder -> typeBuilder)
             .build()
 
  • Constructor Details

    • CustomBuilder

      public CustomBuilder()
  • Method Details

    • type

      The Type that provides the field definitions for this object. If the referenced Type does not exist, the state of the ImportOperation will be set to unresolved until the referenced Type is created.

      Parameters:
      builder - function to build the type value
      Returns:
      Builder
    • withType

      The Type that provides the field definitions for this object. If the referenced Type does not exist, the state of the ImportOperation will be set to unresolved until the referenced Type is created.

      Parameters:
      builder - function to build the type value
      Returns:
      Builder
    • type

      public CustomBuilder type(TypeKeyReference type)

      The Type that provides the field definitions for this object. If the referenced Type does not exist, the state of the ImportOperation will be set to unresolved until the referenced Type is created.

      Parameters:
      type - value to be set
      Returns:
      Builder
    • fields

      The Custom Fields of this object.

      Parameters:
      builder - function to build the fields value
      Returns:
      Builder
    • withFields

      The Custom Fields of this object.

      Parameters:
      builder - function to build the fields value
      Returns:
      Builder
    • fields

      public CustomBuilder fields(@Nullable FieldContainer fields)

      The Custom Fields of this object.

      Parameters:
      fields - value to be set
      Returns:
      Builder
    • getType

      public TypeKeyReference getType()

      The Type that provides the field definitions for this object. If the referenced Type does not exist, the state of the ImportOperation will be set to unresolved until the referenced Type is created.

      Returns:
      type
    • getFields

      @Nullable public FieldContainer getFields()

      The Custom Fields of this object.

      Returns:
      fields
    • build

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

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

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

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