Class AttributesBuilder

java.lang.Object
com.commercetools.importapi.models.productvariants.AttributesBuilder
All Implemented Interfaces:
Builder<Attributes>

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

     Attributes attributes = Attributes.builder()
             .build()
 
  • Constructor Details

    • AttributesBuilder

      public AttributesBuilder()
  • Method Details

    • values

      public AttributesBuilder values(Map<String,Attribute> values)

      The name of the attribute is given by the key and shouldn't be set on the attribute itself. And since this property will be represented as a map, we can set individual attributes to null to delete them (which follows JSON Merge Patch semantics).

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

      public AttributesBuilder addValue(String key, Attribute value)

      The name of the attribute is given by the key and shouldn't be set on the attribute itself. And since this property will be represented as a map, we can set individual attributes to null to delete them (which follows JSON Merge Patch semantics).

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

      public Map<String,Attribute> getValues()

      The name of the attribute is given by the key and shouldn't be set on the attribute itself. And since this property will be represented as a map, we can set individual attributes to null to delete them (which follows JSON Merge Patch semantics).

      Returns:
      pattern properties
    • build

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

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

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

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