001
002package com.commercetools.history.models.common;
003
004import java.time.*;
005import java.util.*;
006import java.util.function.Function;
007
008import javax.annotation.Nullable;
009import javax.validation.Valid;
010import javax.validation.constraints.NotNull;
011
012import com.fasterxml.jackson.annotation.*;
013import com.fasterxml.jackson.databind.annotation.*;
014
015import io.vrap.rmf.base.client.utils.Generated;
016
017/**
018 * SearchKeyword
019 *
020 * <hr>
021 * Example to create an instance using the builder pattern
022 * <div class=code-example>
023 * <pre><code class='java'>
024 *     SearchKeyword searchKeyword = SearchKeyword.builder()
025 *             .text("{text}")
026 *             .suggestTokenizer(suggestTokenizerBuilder -> suggestTokenizerBuilder)
027 *             .build()
028 * </code></pre>
029 * </div>
030 */
031@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
032@JsonDeserialize(as = SearchKeywordImpl.class)
033public interface SearchKeyword {
034
035    /**
036     *
037     * @return text
038     */
039    @NotNull
040    @JsonProperty("text")
041    public String getText();
042
043    /**
044     *
045     * @return suggestTokenizer
046     */
047    @NotNull
048    @Valid
049    @JsonProperty("suggestTokenizer")
050    public SuggestTokenizer getSuggestTokenizer();
051
052    /**
053     * set text
054     * @param text value to be set
055     */
056
057    public void setText(final String text);
058
059    /**
060     * set suggestTokenizer
061     * @param suggestTokenizer value to be set
062     */
063
064    public void setSuggestTokenizer(final SuggestTokenizer suggestTokenizer);
065
066    /**
067     * factory method
068     * @return instance of SearchKeyword
069     */
070    public static SearchKeyword of() {
071        return new SearchKeywordImpl();
072    }
073
074    /**
075     * factory method to create a shallow copy SearchKeyword
076     * @param template instance to be copied
077     * @return copy instance
078     */
079    public static SearchKeyword of(final SearchKeyword template) {
080        SearchKeywordImpl instance = new SearchKeywordImpl();
081        instance.setText(template.getText());
082        instance.setSuggestTokenizer(template.getSuggestTokenizer());
083        return instance;
084    }
085
086    /**
087     * factory method to create a deep copy of SearchKeyword
088     * @param template instance to be copied
089     * @return copy instance
090     */
091    @Nullable
092    public static SearchKeyword deepCopy(@Nullable final SearchKeyword template) {
093        if (template == null) {
094            return null;
095        }
096        SearchKeywordImpl instance = new SearchKeywordImpl();
097        instance.setText(template.getText());
098        instance.setSuggestTokenizer(
099            com.commercetools.history.models.common.SuggestTokenizer.deepCopy(template.getSuggestTokenizer()));
100        return instance;
101    }
102
103    /**
104     * builder factory method for SearchKeyword
105     * @return builder
106     */
107    public static SearchKeywordBuilder builder() {
108        return SearchKeywordBuilder.of();
109    }
110
111    /**
112     * create builder for SearchKeyword instance
113     * @param template instance with prefilled values for the builder
114     * @return builder
115     */
116    public static SearchKeywordBuilder builder(final SearchKeyword template) {
117        return SearchKeywordBuilder.of(template);
118    }
119
120    /**
121     * accessor map function
122     * @param <T> mapped type
123     * @param helper function to map the object
124     * @return mapped value
125     */
126    default <T> T withSearchKeyword(Function<SearchKeyword, T> helper) {
127        return helper.apply(this);
128    }
129
130    /**
131     * gives a TypeReference for usage with Jackson DataBind
132     * @return TypeReference
133     */
134    public static com.fasterxml.jackson.core.type.TypeReference<SearchKeyword> typeReference() {
135        return new com.fasterxml.jackson.core.type.TypeReference<SearchKeyword>() {
136            @Override
137            public String toString() {
138                return "TypeReference<SearchKeyword>";
139            }
140        };
141    }
142}