Class SearchKeywordBuilder

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

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

     SearchKeyword searchKeyword = SearchKeyword.builder()
             .text("{text}")
             .suggestTokenizer(suggestTokenizerBuilder -> suggestTokenizerBuilder)
             .build()
 
  • Constructor Details

    • SearchKeywordBuilder

      public SearchKeywordBuilder()
  • Method Details

    • text

      public SearchKeywordBuilder text(String text)
      set the value to the text
      Parameters:
      text - value to be set
      Returns:
      Builder
    • suggestTokenizer

      set the value to the suggestTokenizer using the builder function
      Parameters:
      builder - function to build the suggestTokenizer value
      Returns:
      Builder
    • withSuggestTokenizer

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

      public SearchKeywordBuilder suggestTokenizer(SuggestTokenizer suggestTokenizer)
      set the value to the suggestTokenizer
      Parameters:
      suggestTokenizer - value to be set
      Returns:
      Builder
    • getText

      public String getText()
      value of text}
      Returns:
      text
    • getSuggestTokenizer

      public SuggestTokenizer getSuggestTokenizer()
      value of suggestTokenizer}
      Returns:
      suggestTokenizer
    • build

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

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

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

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