Class CustomFieldsBuilder

java.lang.Object
com.commercetools.api.models.type.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

      Reference to the Type that holds the FieldDefinitions for the Custom Fields.

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

      Reference to the Type that holds the FieldDefinitions for the Custom Fields.

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

      public CustomFieldsBuilder type(TypeReference type)

      Reference to the Type that holds the FieldDefinitions for the Custom Fields.

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

      Object containing the Custom Fields for the customized resource or data type.

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

      Object containing the Custom Fields for the customized resource or data type.

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

      public CustomFieldsBuilder fields(FieldContainer fields)

      Object containing the Custom Fields for the customized resource or data type.

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

      public TypeReference getType()

      Reference to the Type that holds the FieldDefinitions for the Custom Fields.

      Returns:
      type
    • getFields

      public FieldContainer getFields()

      Object containing the Custom Fields for the customized resource or data type.

      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