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

com.arakelian.elastic.model.search.ImmutableMatchQuery Maven / Gradle / Ivy

package com.arakelian.elastic.model.search;

import com.arakelian.core.feature.Nullable;
import com.arakelian.elastic.model.enums.Operator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.google.common.base.MoreObjects;
import com.google.errorprone.annotations.CanIgnoreReturnValue;
import com.google.errorprone.annotations.Var;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import javax.annotation.CheckReturnValue;
import javax.annotation.ParametersAreNonnullByDefault;
import javax.annotation.concurrent.Immutable;
import javax.annotation.concurrent.NotThreadSafe;
import org.immutables.value.Generated;

/**
 * Immutable implementation of {@link MatchQuery}.
 * 

* Use the builder to create immutable instances: * {@code ImmutableMatchQuery.builder()}. */ @Generated(from = "MatchQuery", generator = "Immutables") @SuppressWarnings({"all"}) @ParametersAreNonnullByDefault @javax.annotation.processing.Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableMatchQuery implements MatchQuery { private final @Nullable Float boost; private final @Nullable String name; private final boolean hasStandardDefaults; private final @Nullable String analyzer; private final @Nullable Float cutoffFrequency; private final String fieldName; private final @Nullable String fuzziness; private final @Nullable String fuzzyRewrite; private final @Nullable Integer maxExpansions; private final @Nullable String minimumShouldMatch; private final @Nullable Operator operator; private final @Nullable Integer prefixLength; private final @Nullable Object value; private final @Nullable MatchQuery.ZeroTermsQuery zeroTermsQuery; private final boolean hasMatchDefaults; private final @Nullable Boolean autoGenerateSynonymsPhraseQuery; private final @Nullable Boolean fuzzyTranspositions; private final @Nullable Boolean lenient; private ImmutableMatchQuery(ImmutableMatchQuery.Builder builder) { this.boost = builder.boost; this.name = builder.name; this.analyzer = builder.analyzer; this.cutoffFrequency = builder.cutoffFrequency; this.fieldName = builder.fieldName; this.fuzziness = builder.fuzziness; this.fuzzyRewrite = builder.fuzzyRewrite; this.maxExpansions = builder.maxExpansions; this.minimumShouldMatch = builder.minimumShouldMatch; this.operator = builder.operator; this.prefixLength = builder.prefixLength; this.value = builder.value; this.zeroTermsQuery = builder.zeroTermsQuery; this.autoGenerateSynonymsPhraseQuery = builder.autoGenerateSynonymsPhraseQuery; this.fuzzyTranspositions = builder.fuzzyTranspositions; this.lenient = builder.lenient; this.hasStandardDefaults = initShim.hasStandardDefaults(); this.hasMatchDefaults = initShim.hasMatchDefaults(); this.initShim = null; } private static final byte STAGE_INITIALIZING = -1; private static final byte STAGE_UNINITIALIZED = 0; private static final byte STAGE_INITIALIZED = 1; @SuppressWarnings("Immutable") private transient volatile InitShim initShim = new InitShim(); @Generated(from = "MatchQuery", generator = "Immutables") private final class InitShim { private byte hasStandardDefaultsBuildStage = STAGE_UNINITIALIZED; private boolean hasStandardDefaults; boolean hasStandardDefaults() { if (hasStandardDefaultsBuildStage == STAGE_INITIALIZING) throw new IllegalStateException(formatInitCycleMessage()); if (hasStandardDefaultsBuildStage == STAGE_UNINITIALIZED) { hasStandardDefaultsBuildStage = STAGE_INITIALIZING; this.hasStandardDefaults = hasStandardDefaultsInitialize(); hasStandardDefaultsBuildStage = STAGE_INITIALIZED; } return this.hasStandardDefaults; } private byte hasMatchDefaultsBuildStage = STAGE_UNINITIALIZED; private boolean hasMatchDefaults; boolean hasMatchDefaults() { if (hasMatchDefaultsBuildStage == STAGE_INITIALIZING) throw new IllegalStateException(formatInitCycleMessage()); if (hasMatchDefaultsBuildStage == STAGE_UNINITIALIZED) { hasMatchDefaultsBuildStage = STAGE_INITIALIZING; this.hasMatchDefaults = hasMatchDefaultsInitialize(); hasMatchDefaultsBuildStage = STAGE_INITIALIZED; } return this.hasMatchDefaults; } private String formatInitCycleMessage() { List attributes = new ArrayList<>(); if (hasStandardDefaultsBuildStage == STAGE_INITIALIZING) attributes.add("hasStandardDefaults"); if (hasMatchDefaultsBuildStage == STAGE_INITIALIZING) attributes.add("hasMatchDefaults"); return "Cannot build MatchQuery, attribute initializers form cycle " + attributes; } } private boolean hasStandardDefaultsInitialize() { return MatchQuery.super.hasStandardDefaults(); } private boolean hasMatchDefaultsInitialize() { return MatchQuery.super.hasMatchDefaults(); } /** * @return The value of the {@code boost} attribute */ @JsonProperty("boost") @Override public @Nullable Float getBoost() { return boost; } /** * Returns the name of the query * @return name of the query * @see Named * Queries */ @JsonProperty("_name") @Override public @Nullable String getName() { return name; } /** * @return The computed-at-construction value of the {@code hasStandardDefaults} attribute */ @JsonProperty("hasStandardDefaults") @JsonIgnore @Override public boolean hasStandardDefaults() { InitShim shim = this.initShim; return shim != null ? shim.hasStandardDefaults() : this.hasStandardDefaults; } /** * @return The value of the {@code analyzer} attribute */ @JsonProperty("analyzer") @Override public @Nullable String getAnalyzer() { return analyzer; } /** * @return The value of the {@code cutoffFrequency} attribute */ @JsonProperty("cutoffFrequency") @Override public @Nullable Float getCutoffFrequency() { return cutoffFrequency; } /** * @return The value of the {@code fieldName} attribute */ @JsonProperty("fieldName") @Override public String getFieldName() { return fieldName; } /** * @return The value of the {@code fuzziness} attribute */ @JsonProperty("fuzziness") @Override public @Nullable String getFuzziness() { return fuzziness; } /** * @return The value of the {@code fuzzyRewrite} attribute */ @JsonProperty("fuzzyRewrite") @Override public @Nullable String getFuzzyRewrite() { return fuzzyRewrite; } /** * @return The value of the {@code maxExpansions} attribute */ @JsonProperty("maxExpansions") @Override public @Nullable Integer getMaxExpansions() { return maxExpansions; } /** * @return The value of the {@code minimumShouldMatch} attribute */ @JsonProperty("minimumShouldMatch") @Override public @Nullable String getMinimumShouldMatch() { return minimumShouldMatch; } /** * @return The value of the {@code operator} attribute */ @JsonProperty("operator") @Override public @Nullable Operator getOperator() { return operator; } /** * @return The value of the {@code prefixLength} attribute */ @JsonProperty("prefixLength") @Override public @Nullable Integer getPrefixLength() { return prefixLength; } /** * @return The value of the {@code value} attribute */ @JsonProperty("value") @Override public @Nullable Object getValue() { return value; } /** * @return The value of the {@code zeroTermsQuery} attribute */ @JsonProperty("zeroTermsQuery") @Override public @Nullable MatchQuery.ZeroTermsQuery getZeroTermsQuery() { return zeroTermsQuery; } /** * @return The computed-at-construction value of the {@code hasMatchDefaults} attribute */ @JsonProperty("hasMatchDefaults") @JsonIgnore @Override public boolean hasMatchDefaults() { InitShim shim = this.initShim; return shim != null ? shim.hasMatchDefaults() : this.hasMatchDefaults; } /** * @return The value of the {@code autoGenerateSynonymsPhraseQuery} attribute */ @JsonProperty("autoGenerateSynonymsPhraseQuery") @Override public @Nullable Boolean isAutoGenerateSynonymsPhraseQuery() { return autoGenerateSynonymsPhraseQuery; } /** * @return The value of the {@code fuzzyTranspositions} attribute */ @JsonProperty("fuzzyTranspositions") @Override public @Nullable Boolean isFuzzyTranspositions() { return fuzzyTranspositions; } /** * @return The value of the {@code lenient} attribute */ @JsonProperty("lenient") @Override public @Nullable Boolean isLenient() { return lenient; } /** * This instance is equal to all instances of {@code ImmutableMatchQuery} that have equal attribute values. * @return {@code true} if {@code this} is equal to {@code another} instance */ @Override public boolean equals(@javax.annotation.Nullable Object another) { if (this == another) return true; return another instanceof ImmutableMatchQuery && equalTo((ImmutableMatchQuery) another); } private boolean equalTo(ImmutableMatchQuery another) { return Objects.equals(boost, another.boost) && Objects.equals(name, another.name) && Objects.equals(analyzer, another.analyzer) && Objects.equals(cutoffFrequency, another.cutoffFrequency) && fieldName.equals(another.fieldName) && Objects.equals(fuzziness, another.fuzziness) && Objects.equals(fuzzyRewrite, another.fuzzyRewrite) && Objects.equals(maxExpansions, another.maxExpansions) && Objects.equals(minimumShouldMatch, another.minimumShouldMatch) && Objects.equals(operator, another.operator) && Objects.equals(prefixLength, another.prefixLength) && Objects.equals(value, another.value) && Objects.equals(zeroTermsQuery, another.zeroTermsQuery) && Objects.equals(autoGenerateSynonymsPhraseQuery, another.autoGenerateSynonymsPhraseQuery) && Objects.equals(fuzzyTranspositions, another.fuzzyTranspositions) && Objects.equals(lenient, another.lenient); } /** * Computes a hash code from attributes: {@code boost}, {@code name}, {@code analyzer}, {@code cutoffFrequency}, {@code fieldName}, {@code fuzziness}, {@code fuzzyRewrite}, {@code maxExpansions}, {@code minimumShouldMatch}, {@code operator}, {@code prefixLength}, {@code value}, {@code zeroTermsQuery}, {@code autoGenerateSynonymsPhraseQuery}, {@code fuzzyTranspositions}, {@code lenient}. * @return hashCode value */ @Override public int hashCode() { @Var int h = 5381; h += (h << 5) + Objects.hashCode(boost); h += (h << 5) + Objects.hashCode(name); h += (h << 5) + Objects.hashCode(analyzer); h += (h << 5) + Objects.hashCode(cutoffFrequency); h += (h << 5) + fieldName.hashCode(); h += (h << 5) + Objects.hashCode(fuzziness); h += (h << 5) + Objects.hashCode(fuzzyRewrite); h += (h << 5) + Objects.hashCode(maxExpansions); h += (h << 5) + Objects.hashCode(minimumShouldMatch); h += (h << 5) + Objects.hashCode(operator); h += (h << 5) + Objects.hashCode(prefixLength); h += (h << 5) + Objects.hashCode(value); h += (h << 5) + Objects.hashCode(zeroTermsQuery); h += (h << 5) + Objects.hashCode(autoGenerateSynonymsPhraseQuery); h += (h << 5) + Objects.hashCode(fuzzyTranspositions); h += (h << 5) + Objects.hashCode(lenient); return h; } /** * Prints the immutable value {@code MatchQuery} with attribute values. * @return A string representation of the value */ @Override public String toString() { return MoreObjects.toStringHelper("MatchQuery") .omitNullValues() .add("boost", boost) .add("name", name) .add("analyzer", analyzer) .add("cutoffFrequency", cutoffFrequency) .add("fieldName", fieldName) .add("fuzziness", fuzziness) .add("fuzzyRewrite", fuzzyRewrite) .add("maxExpansions", maxExpansions) .add("minimumShouldMatch", minimumShouldMatch) .add("operator", operator) .add("prefixLength", prefixLength) .add("value", value) .add("zeroTermsQuery", zeroTermsQuery) .add("autoGenerateSynonymsPhraseQuery", autoGenerateSynonymsPhraseQuery) .add("fuzzyTranspositions", fuzzyTranspositions) .add("lenient", lenient) .toString(); } /** * Creates a builder for {@link ImmutableMatchQuery ImmutableMatchQuery}. *

   * ImmutableMatchQuery.builder()
   *    .boost(Float | null) // nullable {@link MatchQuery#getBoost() boost}
   *    .name(String | null) // nullable {@link MatchQuery#getName() name}
   *    .analyzer(String | null) // nullable {@link MatchQuery#getAnalyzer() analyzer}
   *    .cutoffFrequency(Float | null) // nullable {@link MatchQuery#getCutoffFrequency() cutoffFrequency}
   *    .fieldName(String) // required {@link MatchQuery#getFieldName() fieldName}
   *    .fuzziness(String | null) // nullable {@link MatchQuery#getFuzziness() fuzziness}
   *    .fuzzyRewrite(String | null) // nullable {@link MatchQuery#getFuzzyRewrite() fuzzyRewrite}
   *    .maxExpansions(Integer | null) // nullable {@link MatchQuery#getMaxExpansions() maxExpansions}
   *    .minimumShouldMatch(String | null) // nullable {@link MatchQuery#getMinimumShouldMatch() minimumShouldMatch}
   *    .operator(com.arakelian.elastic.model.enums.Operator | null) // nullable {@link MatchQuery#getOperator() operator}
   *    .prefixLength(Integer | null) // nullable {@link MatchQuery#getPrefixLength() prefixLength}
   *    .value(Object | null) // nullable {@link MatchQuery#getValue() value}
   *    .zeroTermsQuery(com.arakelian.elastic.model.search.MatchQuery.ZeroTermsQuery | null) // nullable {@link MatchQuery#getZeroTermsQuery() zeroTermsQuery}
   *    .autoGenerateSynonymsPhraseQuery(Boolean | null) // nullable {@link MatchQuery#isAutoGenerateSynonymsPhraseQuery() autoGenerateSynonymsPhraseQuery}
   *    .fuzzyTranspositions(Boolean | null) // nullable {@link MatchQuery#isFuzzyTranspositions() fuzzyTranspositions}
   *    .lenient(Boolean | null) // nullable {@link MatchQuery#isLenient() lenient}
   *    .build();
   * 
* @return A new ImmutableMatchQuery builder */ public static ImmutableMatchQuery.Builder builder() { return new ImmutableMatchQuery.Builder(); } /** * Builds instances of type {@link ImmutableMatchQuery ImmutableMatchQuery}. * Initialize attributes and then invoke the {@link #build()} method to create an * immutable instance. *

{@code Builder} is not thread-safe and generally should not be stored in a field or collection, * but instead used immediately to create instances. */ @Generated(from = "MatchQuery", generator = "Immutables") @NotThreadSafe @JsonTypeName("match") public static final class Builder { private static final long INIT_BIT_FIELD_NAME = 0x1L; private long initBits = 0x1L; private @javax.annotation.Nullable Float boost; private @javax.annotation.Nullable String name; private @javax.annotation.Nullable String analyzer; private @javax.annotation.Nullable Float cutoffFrequency; private @javax.annotation.Nullable String fieldName; private @javax.annotation.Nullable String fuzziness; private @javax.annotation.Nullable String fuzzyRewrite; private @javax.annotation.Nullable Integer maxExpansions; private @javax.annotation.Nullable String minimumShouldMatch; private @javax.annotation.Nullable Operator operator; private @javax.annotation.Nullable Integer prefixLength; private @javax.annotation.Nullable Object value; private @javax.annotation.Nullable MatchQuery.ZeroTermsQuery zeroTermsQuery; private @javax.annotation.Nullable Boolean autoGenerateSynonymsPhraseQuery; private @javax.annotation.Nullable Boolean fuzzyTranspositions; private @javax.annotation.Nullable Boolean lenient; private Builder() { } /** * Fill a builder with attribute values from the provided {@code com.arakelian.elastic.model.search.StandardQuery} instance. * @param instance The instance from which to copy values * @return {@code this} builder for use in a chained invocation */ @CanIgnoreReturnValue public final Builder from(StandardQuery instance) { Objects.requireNonNull(instance, "instance"); from((Object) instance); return this; } /** * Fill a builder with attribute values from the provided {@code com.arakelian.elastic.model.search.MatchQuery} instance. * @param instance The instance from which to copy values * @return {@code this} builder for use in a chained invocation */ @CanIgnoreReturnValue public final Builder from(MatchQuery instance) { Objects.requireNonNull(instance, "instance"); from((Object) instance); return this; } private void from(Object object) { if (object instanceof StandardQuery) { StandardQuery instance = (StandardQuery) object; String nameValue = instance.getName(); if (nameValue != null) { name(nameValue); } Float boostValue = instance.getBoost(); if (boostValue != null) { boost(boostValue); } } if (object instanceof MatchQuery) { MatchQuery instance = (MatchQuery) object; String fuzzinessValue = instance.getFuzziness(); if (fuzzinessValue != null) { fuzziness(fuzzinessValue); } Boolean fuzzyTranspositionsValue = instance.isFuzzyTranspositions(); if (fuzzyTranspositionsValue != null) { fuzzyTranspositions(fuzzyTranspositionsValue); } fieldName(instance.getFieldName()); Float cutoffFrequencyValue = instance.getCutoffFrequency(); if (cutoffFrequencyValue != null) { cutoffFrequency(cutoffFrequencyValue); } Operator operatorValue = instance.getOperator(); if (operatorValue != null) { operator(operatorValue); } Boolean lenientValue = instance.isLenient(); if (lenientValue != null) { lenient(lenientValue); } String minimumShouldMatchValue = instance.getMinimumShouldMatch(); if (minimumShouldMatchValue != null) { minimumShouldMatch(minimumShouldMatchValue); } Integer prefixLengthValue = instance.getPrefixLength(); if (prefixLengthValue != null) { prefixLength(prefixLengthValue); } Boolean autoGenerateSynonymsPhraseQueryValue = instance.isAutoGenerateSynonymsPhraseQuery(); if (autoGenerateSynonymsPhraseQueryValue != null) { autoGenerateSynonymsPhraseQuery(autoGenerateSynonymsPhraseQueryValue); } String fuzzyRewriteValue = instance.getFuzzyRewrite(); if (fuzzyRewriteValue != null) { fuzzyRewrite(fuzzyRewriteValue); } MatchQuery.ZeroTermsQuery zeroTermsQueryValue = instance.getZeroTermsQuery(); if (zeroTermsQueryValue != null) { zeroTermsQuery(zeroTermsQueryValue); } String analyzerValue = instance.getAnalyzer(); if (analyzerValue != null) { analyzer(analyzerValue); } Object valueValue = instance.getValue(); if (valueValue != null) { value(valueValue); } Integer maxExpansionsValue = instance.getMaxExpansions(); if (maxExpansionsValue != null) { maxExpansions(maxExpansionsValue); } } } /** * Initializes the value for the {@link MatchQuery#getBoost() boost} attribute. * @param boost The value for boost (can be {@code null}) * @return {@code this} builder for use in a chained invocation */ @CanIgnoreReturnValue @JsonProperty("boost") public final Builder boost(@Nullable Float boost) { this.boost = boost; return this; } /** * Initializes the value for the {@link MatchQuery#getName() name} attribute. * @param name The value for name (can be {@code null}) * @return {@code this} builder for use in a chained invocation */ @CanIgnoreReturnValue @JsonProperty("_name") public final Builder name(@Nullable String name) { this.name = name; return this; } /** * Initializes the value for the {@link MatchQuery#getAnalyzer() analyzer} attribute. * @param analyzer The value for analyzer (can be {@code null}) * @return {@code this} builder for use in a chained invocation */ @CanIgnoreReturnValue @JsonProperty("analyzer") public final Builder analyzer(@Nullable String analyzer) { this.analyzer = analyzer; return this; } /** * Initializes the value for the {@link MatchQuery#getCutoffFrequency() cutoffFrequency} attribute. * @param cutoffFrequency The value for cutoffFrequency (can be {@code null}) * @return {@code this} builder for use in a chained invocation */ @CanIgnoreReturnValue @JsonProperty("cutoffFrequency") public final Builder cutoffFrequency(@Nullable Float cutoffFrequency) { this.cutoffFrequency = cutoffFrequency; return this; } /** * Initializes the value for the {@link MatchQuery#getFieldName() fieldName} attribute. * @param fieldName The value for fieldName * @return {@code this} builder for use in a chained invocation */ @CanIgnoreReturnValue @JsonProperty("fieldName") public final Builder fieldName(String fieldName) { this.fieldName = Objects.requireNonNull(fieldName, "fieldName"); initBits &= ~INIT_BIT_FIELD_NAME; return this; } /** * Initializes the value for the {@link MatchQuery#getFuzziness() fuzziness} attribute. * @param fuzziness The value for fuzziness (can be {@code null}) * @return {@code this} builder for use in a chained invocation */ @CanIgnoreReturnValue @JsonProperty("fuzziness") public final Builder fuzziness(@Nullable String fuzziness) { this.fuzziness = fuzziness; return this; } /** * Initializes the value for the {@link MatchQuery#getFuzzyRewrite() fuzzyRewrite} attribute. * @param fuzzyRewrite The value for fuzzyRewrite (can be {@code null}) * @return {@code this} builder for use in a chained invocation */ @CanIgnoreReturnValue @JsonProperty("fuzzyRewrite") public final Builder fuzzyRewrite(@Nullable String fuzzyRewrite) { this.fuzzyRewrite = fuzzyRewrite; return this; } /** * Initializes the value for the {@link MatchQuery#getMaxExpansions() maxExpansions} attribute. * @param maxExpansions The value for maxExpansions (can be {@code null}) * @return {@code this} builder for use in a chained invocation */ @CanIgnoreReturnValue @JsonProperty("maxExpansions") public final Builder maxExpansions(@Nullable Integer maxExpansions) { this.maxExpansions = maxExpansions; return this; } /** * Initializes the value for the {@link MatchQuery#getMinimumShouldMatch() minimumShouldMatch} attribute. * @param minimumShouldMatch The value for minimumShouldMatch (can be {@code null}) * @return {@code this} builder for use in a chained invocation */ @CanIgnoreReturnValue @JsonProperty("minimumShouldMatch") public final Builder minimumShouldMatch(@Nullable String minimumShouldMatch) { this.minimumShouldMatch = minimumShouldMatch; return this; } /** * Initializes the value for the {@link MatchQuery#getOperator() operator} attribute. * @param operator The value for operator (can be {@code null}) * @return {@code this} builder for use in a chained invocation */ @CanIgnoreReturnValue @JsonProperty("operator") public final Builder operator(@Nullable Operator operator) { this.operator = operator; return this; } /** * Initializes the value for the {@link MatchQuery#getPrefixLength() prefixLength} attribute. * @param prefixLength The value for prefixLength (can be {@code null}) * @return {@code this} builder for use in a chained invocation */ @CanIgnoreReturnValue @JsonProperty("prefixLength") public final Builder prefixLength(@Nullable Integer prefixLength) { this.prefixLength = prefixLength; return this; } /** * Initializes the value for the {@link MatchQuery#getValue() value} attribute. * @param value The value for value (can be {@code null}) * @return {@code this} builder for use in a chained invocation */ @CanIgnoreReturnValue @JsonProperty("value") public final Builder value(@Nullable Object value) { this.value = value; return this; } /** * Initializes the value for the {@link MatchQuery#getZeroTermsQuery() zeroTermsQuery} attribute. * @param zeroTermsQuery The value for zeroTermsQuery (can be {@code null}) * @return {@code this} builder for use in a chained invocation */ @CanIgnoreReturnValue @JsonProperty("zeroTermsQuery") public final Builder zeroTermsQuery(@Nullable MatchQuery.ZeroTermsQuery zeroTermsQuery) { this.zeroTermsQuery = zeroTermsQuery; return this; } /** * Initializes the value for the {@link MatchQuery#isAutoGenerateSynonymsPhraseQuery() autoGenerateSynonymsPhraseQuery} attribute. * @param autoGenerateSynonymsPhraseQuery The value for autoGenerateSynonymsPhraseQuery (can be {@code null}) * @return {@code this} builder for use in a chained invocation */ @CanIgnoreReturnValue @JsonProperty("autoGenerateSynonymsPhraseQuery") public final Builder autoGenerateSynonymsPhraseQuery(@Nullable Boolean autoGenerateSynonymsPhraseQuery) { this.autoGenerateSynonymsPhraseQuery = autoGenerateSynonymsPhraseQuery; return this; } /** * Initializes the value for the {@link MatchQuery#isFuzzyTranspositions() fuzzyTranspositions} attribute. * @param fuzzyTranspositions The value for fuzzyTranspositions (can be {@code null}) * @return {@code this} builder for use in a chained invocation */ @CanIgnoreReturnValue @JsonProperty("fuzzyTranspositions") public final Builder fuzzyTranspositions(@Nullable Boolean fuzzyTranspositions) { this.fuzzyTranspositions = fuzzyTranspositions; return this; } /** * Initializes the value for the {@link MatchQuery#isLenient() lenient} attribute. * @param lenient The value for lenient (can be {@code null}) * @return {@code this} builder for use in a chained invocation */ @CanIgnoreReturnValue @JsonProperty("lenient") public final Builder lenient(@Nullable Boolean lenient) { this.lenient = lenient; return this; } /** * Builds a new {@link ImmutableMatchQuery ImmutableMatchQuery}. * @return An immutable instance of MatchQuery * @throws java.lang.IllegalStateException if any required attributes are missing */ public ImmutableMatchQuery build() { if (initBits != 0) { throw new IllegalStateException(formatRequiredAttributesMessage()); } return new ImmutableMatchQuery(this); } private String formatRequiredAttributesMessage() { List attributes = new ArrayList<>(); if ((initBits & INIT_BIT_FIELD_NAME) != 0) attributes.add("fieldName"); return "Cannot build MatchQuery, some of required attributes are not set " + attributes; } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy