CustomNormalizer.java

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
package com.azure.search.documents.indexes.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSetter;
import com.fasterxml.jackson.annotation.JsonTypeId;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;
import java.util.List;

/**
 * Allows you to configure normalization for filterable, sortable, and facetable fields, which by default operate with
 * strict matching. This is a user-defined configuration consisting of at least one or more filters, which modify the
 * token that is stored.
 */
@JsonTypeInfo(
        use = JsonTypeInfo.Id.NAME,
        include = JsonTypeInfo.As.EXISTING_PROPERTY,
        property = "@odata.type",
        visible = true)
@JsonTypeName("#Microsoft.Azure.Search.CustomNormalizer")
@Fluent
public final class CustomNormalizer extends LexicalNormalizer {

    /*
     * Identifies the concrete type of the normalizer.
     */
    @JsonTypeId
    @JsonProperty(value = "@odata.type", required = true)
    private String odataType = "#Microsoft.Azure.Search.CustomNormalizer";

    /*
     * A list of token filters used to filter out or modify the input token.
     * For example, you can specify a lowercase filter that converts all
     * characters to lowercase. The filters are run in the order in which they
     * are listed.
     */
    @JsonProperty(value = "tokenFilters")
    private List<TokenFilterName> tokenFilters;

    /*
     * A list of character filters used to prepare input text before it is
     * processed. For instance, they can replace certain characters or symbols.
     * The filters are run in the order in which they are listed.
     */
    @JsonProperty(value = "charFilters")
    private List<CharFilterName> charFilters;

    /**
     * Creates an instance of CustomNormalizer class.
     *
     * @param name the name value to set.
     */
    @JsonCreator
    public CustomNormalizer(@JsonProperty(value = "name", required = true) String name) {
        super(name);
    }

    /**
     * Get the tokenFilters property: A list of token filters used to filter out or modify the input token. For example,
     * you can specify a lowercase filter that converts all characters to lowercase. The filters are run in the order in
     * which they are listed.
     *
     * @return the tokenFilters value.
     */
    public List<TokenFilterName> getTokenFilters() {
        return this.tokenFilters;
    }

    /**
     * Set the tokenFilters property: A list of token filters used to filter out or modify the input token. For example,
     * you can specify a lowercase filter that converts all characters to lowercase. The filters are run in the order in
     * which they are listed.
     *
     * @param tokenFilters the tokenFilters value to set.
     * @return the CustomNormalizer object itself.
     */
    @JsonSetter
    public CustomNormalizer setTokenFilters(List<TokenFilterName> tokenFilters) {
        this.tokenFilters = tokenFilters;
        return this;
    }

    /**
     * Get the charFilters property: A list of character filters used to prepare input text before it is processed. For
     * instance, they can replace certain characters or symbols. The filters are run in the order in which they are
     * listed.
     *
     * @return the charFilters value.
     */
    public List<CharFilterName> getCharFilters() {
        return this.charFilters;
    }

    /**
     * Set the charFilters property: A list of character filters used to prepare input text before it is processed. For
     * instance, they can replace certain characters or symbols. The filters are run in the order in which they are
     * listed.
     *
     * @param charFilters the charFilters value to set.
     * @return the CustomNormalizer object itself.
     */
    @JsonSetter
    public CustomNormalizer setCharFilters(List<CharFilterName> charFilters) {
        this.charFilters = charFilters;
        return this;
    }

    /**
     * Set the tokenFilters property: A list of token filters used to filter out or modify the input token. For example,
     * you can specify a lowercase filter that converts all characters to lowercase. The filters are run in the order in
     * which they are listed.
     *
     * @param tokenFilters the tokenFilters value to set.
     * @return the CustomNormalizer object itself.
     */
    public CustomNormalizer setTokenFilters(TokenFilterName... tokenFilters) {
        this.tokenFilters = (tokenFilters == null) ? null : java.util.Arrays.asList(tokenFilters);
        return this;
    }

    /**
     * Set the charFilters property: A list of character filters used to prepare input text before it is processed. For
     * instance, they can replace certain characters or symbols. The filters are run in the order in which they are
     * listed.
     *
     * @param charFilters the charFilters value to set.
     * @return the CustomNormalizer object itself.
     */
    public CustomNormalizer setCharFilters(CharFilterName... charFilters) {
        this.charFilters = (charFilters == null) ? null : java.util.Arrays.asList(charFilters);
        return this;
    }
}