Class AttributeDefinitionBuilder

java.lang.Object
com.commercetools.importapi.models.producttypes.AttributeDefinitionBuilder
All Implemented Interfaces:
Builder<AttributeDefinition>

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

     AttributeDefinition attributeDefinition = AttributeDefinition.builder()
             .type(typeBuilder -> typeBuilder)
             .name("{name}")
             .label(labelBuilder -> labelBuilder)
             .isRequired(true)
             .build()
 
  • Constructor Details

    • AttributeDefinitionBuilder

      public AttributeDefinitionBuilder()
  • Method Details

    • type

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

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

      public AttributeDefinitionBuilder name(String name)
      set the value to the name
      Parameters:
      name - value to be set
      Returns:
      Builder
    • label

      A localized string is a JSON object where the keys are of IETF language tag, and the values the corresponding strings used for that language.

      {
          "de": "Hundefutter",
          "en": "dog food"
        }
        
      Parameters:
      builder - function to build the label value
      Returns:
      Builder
    • withLabel

      A localized string is a JSON object where the keys are of IETF language tag, and the values the corresponding strings used for that language.

      {
          "de": "Hundefutter",
          "en": "dog food"
        }
        
      Parameters:
      builder - function to build the label value
      Returns:
      Builder
    • label

      A localized string is a JSON object where the keys are of IETF language tag, and the values the corresponding strings used for that language.

      {
          "de": "Hundefutter",
          "en": "dog food"
        }
        
      Parameters:
      label - value to be set
      Returns:
      Builder
    • isRequired

      public AttributeDefinitionBuilder isRequired(Boolean isRequired)
      set the value to the isRequired
      Parameters:
      isRequired - value to be set
      Returns:
      Builder
    • attributeConstraint

      public AttributeDefinitionBuilder attributeConstraint(@Nullable AttributeConstraintEnum attributeConstraint)
      set the value to the attributeConstraint
      Parameters:
      attributeConstraint - value to be set
      Returns:
      Builder
    • inputTip

      A localized string is a JSON object where the keys are of IETF language tag, and the values the corresponding strings used for that language.

      {
          "de": "Hundefutter",
          "en": "dog food"
        }
        
      Parameters:
      builder - function to build the inputTip value
      Returns:
      Builder
    • withInputTip

      A localized string is a JSON object where the keys are of IETF language tag, and the values the corresponding strings used for that language.

      {
          "de": "Hundefutter",
          "en": "dog food"
        }
        
      Parameters:
      builder - function to build the inputTip value
      Returns:
      Builder
    • inputTip

      A localized string is a JSON object where the keys are of IETF language tag, and the values the corresponding strings used for that language.

      {
          "de": "Hundefutter",
          "en": "dog food"
        }
        
      Parameters:
      inputTip - value to be set
      Returns:
      Builder
    • inputHint

      public AttributeDefinitionBuilder inputHint(@Nullable TextInputHint inputHint)
      set the value to the inputHint
      Parameters:
      inputHint - value to be set
      Returns:
      Builder
    • isSearchable

      public AttributeDefinitionBuilder isSearchable(@Nullable Boolean isSearchable)
      set the value to the isSearchable
      Parameters:
      isSearchable - value to be set
      Returns:
      Builder
    • getType

      public AttributeType getType()
      value of type}
      Returns:
      type
    • getName

      public String getName()
      value of name}
      Returns:
      name
    • getLabel

      public LocalizedString getLabel()

      A localized string is a JSON object where the keys are of IETF language tag, and the values the corresponding strings used for that language.

      {
          "de": "Hundefutter",
          "en": "dog food"
        }
        
      Returns:
      label
    • getIsRequired

      public Boolean getIsRequired()
      value of isRequired}
      Returns:
      isRequired
    • getAttributeConstraint

      @Nullable public AttributeConstraintEnum getAttributeConstraint()
      value of attributeConstraint}
      Returns:
      attributeConstraint
    • getInputTip

      @Nullable public LocalizedString getInputTip()

      A localized string is a JSON object where the keys are of IETF language tag, and the values the corresponding strings used for that language.

      {
          "de": "Hundefutter",
          "en": "dog food"
        }
        
      Returns:
      inputTip
    • getInputHint

      @Nullable public TextInputHint getInputHint()
      value of inputHint}
      Returns:
      inputHint
    • getIsSearchable

      @Nullable public Boolean getIsSearchable()
      value of isSearchable}
      Returns:
      isSearchable
    • build

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

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

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

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