Class SuggestionResultBuilder

java.lang.Object
com.commercetools.api.models.product.SuggestionResultBuilder
All Implemented Interfaces:
Builder<SuggestionResult>

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

     SuggestionResult suggestionResult = SuggestionResult.builder()
             .plus/searchKeywords.[a-z]{2}(-[A-Z]{2})?/(/searchKeywords.[a-z]{2}(-[A-Z]{2})?/Builder -> /searchKeywords.[a-z]{2}(-[A-Z]{2})?/Builder)
             .build()
 
  • Constructor Details

    • SuggestionResultBuilder

      public SuggestionResultBuilder()
  • Method Details

    • values

      public SuggestionResultBuilder values(Map<String,List<Suggestion>> values)

      The result may contain multiple Suggestions identified by their Locale. See Suggestions for two languages.

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

      public SuggestionResultBuilder addValue(String key, List<Suggestion> value)

      The result may contain multiple Suggestions identified by their Locale. See Suggestions for two languages.

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

      public Map<String,List<Suggestion>> getValues()

      The result may contain multiple Suggestions identified by their Locale. See Suggestions for two languages.

      Returns:
      pattern properties
    • build

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

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

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

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