Class TokenFilterDefinition

java.lang.Object
co.elastic.clients.elasticsearch._types.analysis.TokenFilterDefinition
All Implemented Interfaces:
JsonpSerializable, OpenTaggedUnion<TokenFilterDefinition.Kind,Object>, TaggedUnion<TokenFilterDefinition.Kind,Object>

@JsonpDeserializable public class TokenFilterDefinition extends Object implements OpenTaggedUnion<TokenFilterDefinition.Kind,Object>, JsonpSerializable
See Also:
  • Field Details

  • Constructor Details

    • TokenFilterDefinition

      public TokenFilterDefinition(TokenFilterDefinitionVariant value)
    • TokenFilterDefinition

      public TokenFilterDefinition(String kind, JsonData value)
      Build a custom plugin-defined TokenFilterDefinition, given its kind and some JSON data
  • Method Details

    • _kind

      public final TokenFilterDefinition.Kind _kind()
      Description copied from interface: TaggedUnion
      Get the of the kind of variant held by this object.
      Specified by:
      _kind in interface TaggedUnion<TokenFilterDefinition.Kind,Object>
      Returns:
      the variant kind
    • _get

      public final Object _get()
      Specified by:
      _get in interface TaggedUnion<TokenFilterDefinition.Kind,Object>
    • of

    • isApostrophe

      public boolean isApostrophe()
      Is this variant instance of kind apostrophe?
    • apostrophe

      public ApostropheTokenFilter apostrophe()
      Get the apostrophe variant value.
      Throws:
      IllegalStateException - if the current variant is not of the apostrophe kind.
    • isArabicNormalization

      public boolean isArabicNormalization()
      Is this variant instance of kind arabic_normalization?
    • arabicNormalization

      public ArabicNormalizationTokenFilter arabicNormalization()
      Get the arabic_normalization variant value.
      Throws:
      IllegalStateException - if the current variant is not of the arabic_normalization kind.
    • isArabicStem

      public boolean isArabicStem()
      Is this variant instance of kind arabic_stem?
    • arabicStem

      public ArabicStemTokenFilter arabicStem()
      Get the arabic_stem variant value.
      Throws:
      IllegalStateException - if the current variant is not of the arabic_stem kind.
    • isAsciifolding

      public boolean isAsciifolding()
      Is this variant instance of kind asciifolding?
    • asciifolding

      public AsciiFoldingTokenFilter asciifolding()
      Get the asciifolding variant value.
      Throws:
      IllegalStateException - if the current variant is not of the asciifolding kind.
    • isBengaliNormalization

      public boolean isBengaliNormalization()
      Is this variant instance of kind bengali_normalization?
    • bengaliNormalization

      public BengaliNormalizationTokenFilter bengaliNormalization()
      Get the bengali_normalization variant value.
      Throws:
      IllegalStateException - if the current variant is not of the bengali_normalization kind.
    • isBrazilianStem

      public boolean isBrazilianStem()
      Is this variant instance of kind brazilian_stem?
    • brazilianStem

      public BrazilianStemTokenFilter brazilianStem()
      Get the brazilian_stem variant value.
      Throws:
      IllegalStateException - if the current variant is not of the brazilian_stem kind.
    • isCjkBigram

      public boolean isCjkBigram()
      Is this variant instance of kind cjk_bigram?
    • cjkBigram

      public CjkBigramTokenFilter cjkBigram()
      Get the cjk_bigram variant value.
      Throws:
      IllegalStateException - if the current variant is not of the cjk_bigram kind.
    • isCjkWidth

      public boolean isCjkWidth()
      Is this variant instance of kind cjk_width?
    • cjkWidth

      public CjkWidthTokenFilter cjkWidth()
      Get the cjk_width variant value.
      Throws:
      IllegalStateException - if the current variant is not of the cjk_width kind.
    • isClassic

      public boolean isClassic()
      Is this variant instance of kind classic?
    • classic

      public ClassicTokenFilter classic()
      Get the classic variant value.
      Throws:
      IllegalStateException - if the current variant is not of the classic kind.
    • isCommonGrams

      public boolean isCommonGrams()
      Is this variant instance of kind common_grams?
    • commonGrams

      public CommonGramsTokenFilter commonGrams()
      Get the common_grams variant value.
      Throws:
      IllegalStateException - if the current variant is not of the common_grams kind.
    • isCondition

      public boolean isCondition()
      Is this variant instance of kind condition?
    • condition

      public ConditionTokenFilter condition()
      Get the condition variant value.
      Throws:
      IllegalStateException - if the current variant is not of the condition kind.
    • isCzechStem

      public boolean isCzechStem()
      Is this variant instance of kind czech_stem?
    • czechStem

      public CzechStemTokenFilter czechStem()
      Get the czech_stem variant value.
      Throws:
      IllegalStateException - if the current variant is not of the czech_stem kind.
    • isDecimalDigit

      public boolean isDecimalDigit()
      Is this variant instance of kind decimal_digit?
    • decimalDigit

      public DecimalDigitTokenFilter decimalDigit()
      Get the decimal_digit variant value.
      Throws:
      IllegalStateException - if the current variant is not of the decimal_digit kind.
    • isDelimitedPayload

      public boolean isDelimitedPayload()
      Is this variant instance of kind delimited_payload?
    • delimitedPayload

      public DelimitedPayloadTokenFilter delimitedPayload()
      Get the delimited_payload variant value.
      Throws:
      IllegalStateException - if the current variant is not of the delimited_payload kind.
    • isDictionaryDecompounder

      public boolean isDictionaryDecompounder()
      Is this variant instance of kind dictionary_decompounder?
    • dictionaryDecompounder

      public DictionaryDecompounderTokenFilter dictionaryDecompounder()
      Get the dictionary_decompounder variant value.
      Throws:
      IllegalStateException - if the current variant is not of the dictionary_decompounder kind.
    • isDutchStem

      public boolean isDutchStem()
      Is this variant instance of kind dutch_stem?
    • dutchStem

      public DutchStemTokenFilter dutchStem()
      Get the dutch_stem variant value.
      Throws:
      IllegalStateException - if the current variant is not of the dutch_stem kind.
    • isEdgeNgram

      public boolean isEdgeNgram()
      Is this variant instance of kind edge_ngram?
    • edgeNgram

      public EdgeNGramTokenFilter edgeNgram()
      Get the edge_ngram variant value.
      Throws:
      IllegalStateException - if the current variant is not of the edge_ngram kind.
    • isElision

      public boolean isElision()
      Is this variant instance of kind elision?
    • elision

      public ElisionTokenFilter elision()
      Get the elision variant value.
      Throws:
      IllegalStateException - if the current variant is not of the elision kind.
    • isFingerprint

      public boolean isFingerprint()
      Is this variant instance of kind fingerprint?
    • fingerprint

      public FingerprintTokenFilter fingerprint()
      Get the fingerprint variant value.
      Throws:
      IllegalStateException - if the current variant is not of the fingerprint kind.
    • isFlattenGraph

      public boolean isFlattenGraph()
      Is this variant instance of kind flatten_graph?
    • flattenGraph

      public FlattenGraphTokenFilter flattenGraph()
      Get the flatten_graph variant value.
      Throws:
      IllegalStateException - if the current variant is not of the flatten_graph kind.
    • isFrenchStem

      public boolean isFrenchStem()
      Is this variant instance of kind french_stem?
    • frenchStem

      public FrenchStemTokenFilter frenchStem()
      Get the french_stem variant value.
      Throws:
      IllegalStateException - if the current variant is not of the french_stem kind.
    • isGermanNormalization

      public boolean isGermanNormalization()
      Is this variant instance of kind german_normalization?
    • germanNormalization

      public GermanNormalizationTokenFilter germanNormalization()
      Get the german_normalization variant value.
      Throws:
      IllegalStateException - if the current variant is not of the german_normalization kind.
    • isGermanStem

      public boolean isGermanStem()
      Is this variant instance of kind german_stem?
    • germanStem

      public GermanStemTokenFilter germanStem()
      Get the german_stem variant value.
      Throws:
      IllegalStateException - if the current variant is not of the german_stem kind.
    • isHindiNormalization

      public boolean isHindiNormalization()
      Is this variant instance of kind hindi_normalization?
    • hindiNormalization

      public HindiNormalizationTokenFilter hindiNormalization()
      Get the hindi_normalization variant value.
      Throws:
      IllegalStateException - if the current variant is not of the hindi_normalization kind.
    • isHunspell

      public boolean isHunspell()
      Is this variant instance of kind hunspell?
    • hunspell

      public HunspellTokenFilter hunspell()
      Get the hunspell variant value.
      Throws:
      IllegalStateException - if the current variant is not of the hunspell kind.
    • isHyphenationDecompounder

      public boolean isHyphenationDecompounder()
      Is this variant instance of kind hyphenation_decompounder?
    • hyphenationDecompounder

      public HyphenationDecompounderTokenFilter hyphenationDecompounder()
      Get the hyphenation_decompounder variant value.
      Throws:
      IllegalStateException - if the current variant is not of the hyphenation_decompounder kind.
    • isIcuCollation

      public boolean isIcuCollation()
      Is this variant instance of kind icu_collation?
    • icuCollation

      public IcuCollationTokenFilter icuCollation()
      Get the icu_collation variant value.
      Throws:
      IllegalStateException - if the current variant is not of the icu_collation kind.
    • isIcuFolding

      public boolean isIcuFolding()
      Is this variant instance of kind icu_folding?
    • icuFolding

      public IcuFoldingTokenFilter icuFolding()
      Get the icu_folding variant value.
      Throws:
      IllegalStateException - if the current variant is not of the icu_folding kind.
    • isIcuNormalizer

      public boolean isIcuNormalizer()
      Is this variant instance of kind icu_normalizer?
    • icuNormalizer

      public IcuNormalizationTokenFilter icuNormalizer()
      Get the icu_normalizer variant value.
      Throws:
      IllegalStateException - if the current variant is not of the icu_normalizer kind.
    • isIcuTransform

      public boolean isIcuTransform()
      Is this variant instance of kind icu_transform?
    • icuTransform

      public IcuTransformTokenFilter icuTransform()
      Get the icu_transform variant value.
      Throws:
      IllegalStateException - if the current variant is not of the icu_transform kind.
    • isIndicNormalization

      public boolean isIndicNormalization()
      Is this variant instance of kind indic_normalization?
    • indicNormalization

      public IndicNormalizationTokenFilter indicNormalization()
      Get the indic_normalization variant value.
      Throws:
      IllegalStateException - if the current variant is not of the indic_normalization kind.
    • isJaStop

      public boolean isJaStop()
      Is this variant instance of kind ja_stop?
    • jaStop

      public JaStopTokenFilter jaStop()
      Get the ja_stop variant value.
      Throws:
      IllegalStateException - if the current variant is not of the ja_stop kind.
    • isKstem

      public boolean isKstem()
      Is this variant instance of kind kstem?
    • kstem

      public KStemTokenFilter kstem()
      Get the kstem variant value.
      Throws:
      IllegalStateException - if the current variant is not of the kstem kind.
    • isKeepTypes

      public boolean isKeepTypes()
      Is this variant instance of kind keep_types?
    • keepTypes

      public KeepTypesTokenFilter keepTypes()
      Get the keep_types variant value.
      Throws:
      IllegalStateException - if the current variant is not of the keep_types kind.
    • isKeep

      public boolean isKeep()
      Is this variant instance of kind keep?
    • keep

      public KeepWordsTokenFilter keep()
      Get the keep variant value.
      Throws:
      IllegalStateException - if the current variant is not of the keep kind.
    • isKeywordMarker

      public boolean isKeywordMarker()
      Is this variant instance of kind keyword_marker?
    • keywordMarker

      public KeywordMarkerTokenFilter keywordMarker()
      Get the keyword_marker variant value.
      Throws:
      IllegalStateException - if the current variant is not of the keyword_marker kind.
    • isKeywordRepeat

      public boolean isKeywordRepeat()
      Is this variant instance of kind keyword_repeat?
    • keywordRepeat

      public KeywordRepeatTokenFilter keywordRepeat()
      Get the keyword_repeat variant value.
      Throws:
      IllegalStateException - if the current variant is not of the keyword_repeat kind.
    • isKuromojiPartOfSpeech

      public boolean isKuromojiPartOfSpeech()
      Is this variant instance of kind kuromoji_part_of_speech?
    • kuromojiPartOfSpeech

      public KuromojiPartOfSpeechTokenFilter kuromojiPartOfSpeech()
      Get the kuromoji_part_of_speech variant value.
      Throws:
      IllegalStateException - if the current variant is not of the kuromoji_part_of_speech kind.
    • isKuromojiReadingform

      public boolean isKuromojiReadingform()
      Is this variant instance of kind kuromoji_readingform?
    • kuromojiReadingform

      public KuromojiReadingFormTokenFilter kuromojiReadingform()
      Get the kuromoji_readingform variant value.
      Throws:
      IllegalStateException - if the current variant is not of the kuromoji_readingform kind.
    • isKuromojiStemmer

      public boolean isKuromojiStemmer()
      Is this variant instance of kind kuromoji_stemmer?
    • kuromojiStemmer

      public KuromojiStemmerTokenFilter kuromojiStemmer()
      Get the kuromoji_stemmer variant value.
      Throws:
      IllegalStateException - if the current variant is not of the kuromoji_stemmer kind.
    • isLength

      public boolean isLength()
      Is this variant instance of kind length?
    • length

      public LengthTokenFilter length()
      Get the length variant value.
      Throws:
      IllegalStateException - if the current variant is not of the length kind.
    • isLimit

      public boolean isLimit()
      Is this variant instance of kind limit?
    • limit

      Get the limit variant value.
      Throws:
      IllegalStateException - if the current variant is not of the limit kind.
    • isLowercase

      public boolean isLowercase()
      Is this variant instance of kind lowercase?
    • lowercase

      public LowercaseTokenFilter lowercase()
      Get the lowercase variant value.
      Throws:
      IllegalStateException - if the current variant is not of the lowercase kind.
    • isMinHash

      public boolean isMinHash()
      Is this variant instance of kind min_hash?
    • minHash

      public MinHashTokenFilter minHash()
      Get the min_hash variant value.
      Throws:
      IllegalStateException - if the current variant is not of the min_hash kind.
    • isMultiplexer

      public boolean isMultiplexer()
      Is this variant instance of kind multiplexer?
    • multiplexer

      public MultiplexerTokenFilter multiplexer()
      Get the multiplexer variant value.
      Throws:
      IllegalStateException - if the current variant is not of the multiplexer kind.
    • isNgram

      public boolean isNgram()
      Is this variant instance of kind ngram?
    • ngram

      public NGramTokenFilter ngram()
      Get the ngram variant value.
      Throws:
      IllegalStateException - if the current variant is not of the ngram kind.
    • isNoriPartOfSpeech

      public boolean isNoriPartOfSpeech()
      Is this variant instance of kind nori_part_of_speech?
    • noriPartOfSpeech

      public NoriPartOfSpeechTokenFilter noriPartOfSpeech()
      Get the nori_part_of_speech variant value.
      Throws:
      IllegalStateException - if the current variant is not of the nori_part_of_speech kind.
    • isPatternCapture

      public boolean isPatternCapture()
      Is this variant instance of kind pattern_capture?
    • patternCapture

      public PatternCaptureTokenFilter patternCapture()
      Get the pattern_capture variant value.
      Throws:
      IllegalStateException - if the current variant is not of the pattern_capture kind.
    • isPatternReplace

      public boolean isPatternReplace()
      Is this variant instance of kind pattern_replace?
    • patternReplace

      public PatternReplaceTokenFilter patternReplace()
      Get the pattern_replace variant value.
      Throws:
      IllegalStateException - if the current variant is not of the pattern_replace kind.
    • isPersianNormalization

      public boolean isPersianNormalization()
      Is this variant instance of kind persian_normalization?
    • persianNormalization

      public PersianNormalizationTokenFilter persianNormalization()
      Get the persian_normalization variant value.
      Throws:
      IllegalStateException - if the current variant is not of the persian_normalization kind.
    • isPersianStem

      public boolean isPersianStem()
      Is this variant instance of kind persian_stem?
    • persianStem

      public PersianStemTokenFilter persianStem()
      Get the persian_stem variant value.
      Throws:
      IllegalStateException - if the current variant is not of the persian_stem kind.
    • isPhonetic

      public boolean isPhonetic()
      Is this variant instance of kind phonetic?
    • phonetic

      public PhoneticTokenFilter phonetic()
      Get the phonetic variant value.
      Throws:
      IllegalStateException - if the current variant is not of the phonetic kind.
    • isPorterStem

      public boolean isPorterStem()
      Is this variant instance of kind porter_stem?
    • porterStem

      public PorterStemTokenFilter porterStem()
      Get the porter_stem variant value.
      Throws:
      IllegalStateException - if the current variant is not of the porter_stem kind.
    • isPredicateTokenFilter

      public boolean isPredicateTokenFilter()
      Is this variant instance of kind predicate_token_filter?
    • predicateTokenFilter

      public PredicateTokenFilter predicateTokenFilter()
      Get the predicate_token_filter variant value.
      Throws:
      IllegalStateException - if the current variant is not of the predicate_token_filter kind.
    • isRemoveDuplicates

      public boolean isRemoveDuplicates()
      Is this variant instance of kind remove_duplicates?
    • removeDuplicates

      public RemoveDuplicatesTokenFilter removeDuplicates()
      Get the remove_duplicates variant value.
      Throws:
      IllegalStateException - if the current variant is not of the remove_duplicates kind.
    • isReverse

      public boolean isReverse()
      Is this variant instance of kind reverse?
    • reverse

      public ReverseTokenFilter reverse()
      Get the reverse variant value.
      Throws:
      IllegalStateException - if the current variant is not of the reverse kind.
    • isRussianStem

      public boolean isRussianStem()
      Is this variant instance of kind russian_stem?
    • russianStem

      public RussianStemTokenFilter russianStem()
      Get the russian_stem variant value.
      Throws:
      IllegalStateException - if the current variant is not of the russian_stem kind.
    • isScandinavianFolding

      public boolean isScandinavianFolding()
      Is this variant instance of kind scandinavian_folding?
    • scandinavianFolding

      public ScandinavianFoldingTokenFilter scandinavianFolding()
      Get the scandinavian_folding variant value.
      Throws:
      IllegalStateException - if the current variant is not of the scandinavian_folding kind.
    • isScandinavianNormalization

      public boolean isScandinavianNormalization()
      Is this variant instance of kind scandinavian_normalization?
    • scandinavianNormalization

      public ScandinavianNormalizationTokenFilter scandinavianNormalization()
      Get the scandinavian_normalization variant value.
      Throws:
      IllegalStateException - if the current variant is not of the scandinavian_normalization kind.
    • isSerbianNormalization

      public boolean isSerbianNormalization()
      Is this variant instance of kind serbian_normalization?
    • serbianNormalization

      public SerbianNormalizationTokenFilter serbianNormalization()
      Get the serbian_normalization variant value.
      Throws:
      IllegalStateException - if the current variant is not of the serbian_normalization kind.
    • isShingle

      public boolean isShingle()
      Is this variant instance of kind shingle?
    • shingle

      public ShingleTokenFilter shingle()
      Get the shingle variant value.
      Throws:
      IllegalStateException - if the current variant is not of the shingle kind.
    • isSnowball

      public boolean isSnowball()
      Is this variant instance of kind snowball?
    • snowball

      public SnowballTokenFilter snowball()
      Get the snowball variant value.
      Throws:
      IllegalStateException - if the current variant is not of the snowball kind.
    • isSoraniNormalization

      public boolean isSoraniNormalization()
      Is this variant instance of kind sorani_normalization?
    • soraniNormalization

      public SoraniNormalizationTokenFilter soraniNormalization()
      Get the sorani_normalization variant value.
      Throws:
      IllegalStateException - if the current variant is not of the sorani_normalization kind.
    • isStemmerOverride

      public boolean isStemmerOverride()
      Is this variant instance of kind stemmer_override?
    • stemmerOverride

      public StemmerOverrideTokenFilter stemmerOverride()
      Get the stemmer_override variant value.
      Throws:
      IllegalStateException - if the current variant is not of the stemmer_override kind.
    • isStemmer

      public boolean isStemmer()
      Is this variant instance of kind stemmer?
    • stemmer

      public StemmerTokenFilter stemmer()
      Get the stemmer variant value.
      Throws:
      IllegalStateException - if the current variant is not of the stemmer kind.
    • isStop

      public boolean isStop()
      Is this variant instance of kind stop?
    • stop

      public StopTokenFilter stop()
      Get the stop variant value.
      Throws:
      IllegalStateException - if the current variant is not of the stop kind.
    • isSynonymGraph

      public boolean isSynonymGraph()
      Is this variant instance of kind synonym_graph?
    • synonymGraph

      public SynonymGraphTokenFilter synonymGraph()
      Get the synonym_graph variant value.
      Throws:
      IllegalStateException - if the current variant is not of the synonym_graph kind.
    • isSynonym

      public boolean isSynonym()
      Is this variant instance of kind synonym?
    • synonym

      public SynonymTokenFilter synonym()
      Get the synonym variant value.
      Throws:
      IllegalStateException - if the current variant is not of the synonym kind.
    • isTrim

      public boolean isTrim()
      Is this variant instance of kind trim?
    • trim

      public TrimTokenFilter trim()
      Get the trim variant value.
      Throws:
      IllegalStateException - if the current variant is not of the trim kind.
    • isTruncate

      public boolean isTruncate()
      Is this variant instance of kind truncate?
    • truncate

      public TruncateTokenFilter truncate()
      Get the truncate variant value.
      Throws:
      IllegalStateException - if the current variant is not of the truncate kind.
    • isUnique

      public boolean isUnique()
      Is this variant instance of kind unique?
    • unique

      public UniqueTokenFilter unique()
      Get the unique variant value.
      Throws:
      IllegalStateException - if the current variant is not of the unique kind.
    • isUppercase

      public boolean isUppercase()
      Is this variant instance of kind uppercase?
    • uppercase

      public UppercaseTokenFilter uppercase()
      Get the uppercase variant value.
      Throws:
      IllegalStateException - if the current variant is not of the uppercase kind.
    • isWordDelimiterGraph

      public boolean isWordDelimiterGraph()
      Is this variant instance of kind word_delimiter_graph?
    • wordDelimiterGraph

      public WordDelimiterGraphTokenFilter wordDelimiterGraph()
      Get the word_delimiter_graph variant value.
      Throws:
      IllegalStateException - if the current variant is not of the word_delimiter_graph kind.
    • isWordDelimiter

      public boolean isWordDelimiter()
      Is this variant instance of kind word_delimiter?
    • wordDelimiter

      public WordDelimiterTokenFilter wordDelimiter()
      Get the word_delimiter variant value.
      Throws:
      IllegalStateException - if the current variant is not of the word_delimiter kind.
    • _isCustom

      public boolean _isCustom()
      Is this a custom TokenFilterDefinition defined by a plugin?
    • _customKind

      @Nullable public final String _customKind()
      Get the actual kind when _kind() equals TokenFilterDefinition.Kind._Custom (plugin-defined variant).
      Specified by:
      _customKind in interface OpenTaggedUnion<TokenFilterDefinition.Kind,Object>
    • _custom

      public JsonData _custom()
      Get the custom plugin-defined variant value.
      Throws:
      IllegalStateException - if the current variant is not TokenFilterDefinition.Kind._Custom.
    • serialize

      public void serialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
      Specified by:
      serialize in interface JsonpSerializable
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • setupTokenFilterDefinitionDeserializer

      protected static void setupTokenFilterDefinitionDeserializer(ObjectDeserializer<TokenFilterDefinition.Builder> op)