All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.sphere.sdk.search.SearchKeyword Maven / Gradle / Ivy

There is a newer version: 1.0.0-M26
Show newest version
package io.sphere.sdk.search;

import com.fasterxml.jackson.annotation.JsonCreator;
import io.sphere.sdk.models.Base;
import io.sphere.sdk.search.tokenizer.SuggestTokenizer;

import javax.annotation.Nullable;

public class SearchKeyword extends Base {
    private final String text;
    @Nullable
    private final SuggestTokenizer suggestTokenizer;

    @JsonCreator
    private SearchKeyword(final String text, final SuggestTokenizer suggestTokenizer) {
        this.suggestTokenizer = suggestTokenizer;
        this.text = text;
    }

    @Nullable
    public SuggestTokenizer getSuggestTokenizer() {
        return suggestTokenizer;
    }

    public String getText() {
        return text;
    }

    public static SearchKeyword of(final String text) {
        return of(text, null);
    }

    public static SearchKeyword of(final String text, final SuggestTokenizer suggestTokenizer) {
        return new SearchKeyword(text, suggestTokenizer);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy