Class FieldContainerBuilder

java.lang.Object
com.commercetools.api.models.type.FieldContainerBuilder
All Implemented Interfaces:
Builder<FieldContainer>

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

     FieldContainer fieldContainer = FieldContainer.builder()
             .build()
 
  • Constructor Details

    • FieldContainerBuilder

      public FieldContainerBuilder()
  • Method Details

    • values

      public FieldContainerBuilder values(Map<String,Object> values)

      JSON object with keys matching the names of Custom Fields (that is, names in the FieldDefinitions) and values given by CustomFieldValue.

      Parameters:
      values - properties to be set
      Returns:
      Builder
    • addValue

      public FieldContainerBuilder addValue(String key, Object value)

      JSON object with keys matching the names of Custom Fields (that is, names in the FieldDefinitions) and values given by CustomFieldValue.

      Parameters:
      key - property name
      value - property value
      Returns:
      Builder
    • getValues

      public Map<String,Object> getValues()

      JSON object with keys matching the names of Custom Fields (that is, names in the FieldDefinitions) and values given by CustomFieldValue.

      Returns:
      pattern properties
    • build

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

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

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

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