Class LocalizedEnumValueBuilder

java.lang.Object
com.commercetools.importapi.models.common.LocalizedEnumValueBuilder
All Implemented Interfaces:
Builder<LocalizedEnumValue>

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

     LocalizedEnumValue localizedEnumValue = LocalizedEnumValue.builder()
             .key("{key}")
             .label(labelBuilder -> labelBuilder)
             .build()
 
  • Constructor Details

    • LocalizedEnumValueBuilder

      public LocalizedEnumValueBuilder()
  • Method Details

    • key

      set the value to the key
      Parameters:
      key - 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
    • getKey

      public String getKey()
      value of key}
      Returns:
      key
    • 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
    • build

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

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

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

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