Class CustomFieldsBuilder

java.lang.Object
com.commercetools.history.models.common.CustomFieldsBuilder
All Implemented Interfaces:
Builder<CustomFields>

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

     CustomFields customFields = CustomFields.builder()
             .type(typeBuilder -> typeBuilder)
             .fields(fieldsBuilder -> fieldsBuilder)
             .build()
 
  • Constructor Details

    • CustomFieldsBuilder

      public CustomFieldsBuilder()
  • Method Details

    • type

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

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

      public CustomFieldsBuilder type(Reference type)
      set the value to the type
      Parameters:
      type - value to be set
      Returns:
      Builder
    • fields

      public CustomFieldsBuilder fields(Object fields)

      A valid JSON object, based on FieldDefinition.

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

      public Reference getType()
      value of type}
      Returns:
      type
    • getFields

      public Object getFields()

      A valid JSON object, based on FieldDefinition.

      Returns:
      fields
    • build

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

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

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

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