Class LocalizedStringBuilder

java.lang.Object
com.commercetools.history.models.common.LocalizedStringBuilder
All Implemented Interfaces:
Builder<LocalizedString>

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

     LocalizedString localizedString = LocalizedString.builder()
             ./^[a-z]{2}(-[A-Z]{2})?$/("{/^[a-z]{2}(-[A-Z]{2})?$/}")
             .build()
 
  • Constructor Details

    • LocalizedStringBuilder

      public LocalizedStringBuilder()
  • Method Details

    • values

      public LocalizedStringBuilder values(Map<String,String> values)
      assign pattern properties to the builder
      Parameters:
      values - properties to be set
      Returns:
      Builder
    • addValue

      public LocalizedStringBuilder addValue(String key, String value)
      assign a pattern property to the builder
      Parameters:
      key - property name
      value - property value
      Returns:
      Builder
    • getValues

      public Map<String,String> getValues()
      values of pattern properties
      Returns:
      pattern properties
    • build

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

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

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

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