Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
* Use the builder to create immutable instances:
* {@code ImmutableMoreLikeThisQuery.builder()}.
*/
@Generated(from = "MoreLikeThisQuery", generator = "Immutables")
@SuppressWarnings({"all"})
@ParametersAreNonnullByDefault
@javax.annotation.processing.Generated("org.immutables.processor.ProxyProcessor")
@Immutable
@CheckReturnValue
public final class ImmutableMoreLikeThisQuery implements MoreLikeThisQuery {
private final @Nullable Float boost;
private final @Nullable String name;
private final boolean hasStandardDefaults;
private final @Nullable String analyzer;
private final @Nullable Float boostTerms;
private final ImmutableSet fields;
private final ImmutableList likeItems;
private final ImmutableList likeTexts;
private final @Nullable Integer maxDocFrequency;
private final @Nullable Integer maxQueryTerms;
private final @Nullable Integer maxWordLength;
private final @Nullable Integer minDocFrequency;
private final @Nullable String minimumShouldMatch;
private final @Nullable Integer minTermFrequency;
private final @Nullable Integer minWordLength;
private final ImmutableSet stopWords;
private final ImmutableList unlikeItems;
private final ImmutableList unlikeTexts;
private final @Nullable Boolean failOnUnsupportedField;
private final @Nullable Boolean include;
private ImmutableMoreLikeThisQuery(ImmutableMoreLikeThisQuery.Builder builder) {
this.boost = builder.boost;
this.name = builder.name;
this.analyzer = builder.analyzer;
this.boostTerms = builder.boostTerms;
this.maxDocFrequency = builder.maxDocFrequency;
this.maxQueryTerms = builder.maxQueryTerms;
this.maxWordLength = builder.maxWordLength;
this.minDocFrequency = builder.minDocFrequency;
this.minimumShouldMatch = builder.minimumShouldMatch;
this.minTermFrequency = builder.minTermFrequency;
this.minWordLength = builder.minWordLength;
this.failOnUnsupportedField = builder.failOnUnsupportedField;
this.include = builder.include;
if (builder.fieldsIsSet()) {
initShim.fields(builder.fields.build());
}
if (builder.likeItemsIsSet()) {
initShim.likeItems(builder.likeItems.build());
}
if (builder.likeTextsIsSet()) {
initShim.likeTexts(builder.likeTexts.build());
}
if (builder.stopWordsIsSet()) {
initShim.stopWords(builder.stopWords.build());
}
if (builder.unlikeItemsIsSet()) {
initShim.unlikeItems(builder.unlikeItems.build());
}
if (builder.unlikeTextsIsSet()) {
initShim.unlikeTexts(builder.unlikeTexts.build());
}
this.hasStandardDefaults = initShim.hasStandardDefaults();
this.fields = initShim.getFields();
this.likeItems = initShim.getLikeItems();
this.likeTexts = initShim.getLikeTexts();
this.stopWords = initShim.getStopWords();
this.unlikeItems = initShim.getUnlikeItems();
this.unlikeTexts = initShim.getUnlikeTexts();
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 = "MoreLikeThisQuery", 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 fieldsBuildStage = STAGE_UNINITIALIZED;
private ImmutableSet fields;
ImmutableSet getFields() {
if (fieldsBuildStage == STAGE_INITIALIZING) throw new IllegalStateException(formatInitCycleMessage());
if (fieldsBuildStage == STAGE_UNINITIALIZED) {
fieldsBuildStage = STAGE_INITIALIZING;
this.fields = ImmutableSet.copyOf(getFieldsInitialize());
fieldsBuildStage = STAGE_INITIALIZED;
}
return this.fields;
}
void fields(ImmutableSet fields) {
this.fields = fields;
fieldsBuildStage = STAGE_INITIALIZED;
}
private byte likeItemsBuildStage = STAGE_UNINITIALIZED;
private ImmutableList likeItems;
ImmutableList getLikeItems() {
if (likeItemsBuildStage == STAGE_INITIALIZING) throw new IllegalStateException(formatInitCycleMessage());
if (likeItemsBuildStage == STAGE_UNINITIALIZED) {
likeItemsBuildStage = STAGE_INITIALIZING;
this.likeItems = ImmutableList.copyOf(getLikeItemsInitialize());
likeItemsBuildStage = STAGE_INITIALIZED;
}
return this.likeItems;
}
void likeItems(ImmutableList likeItems) {
this.likeItems = likeItems;
likeItemsBuildStage = STAGE_INITIALIZED;
}
private byte likeTextsBuildStage = STAGE_UNINITIALIZED;
private ImmutableList likeTexts;
ImmutableList getLikeTexts() {
if (likeTextsBuildStage == STAGE_INITIALIZING) throw new IllegalStateException(formatInitCycleMessage());
if (likeTextsBuildStage == STAGE_UNINITIALIZED) {
likeTextsBuildStage = STAGE_INITIALIZING;
this.likeTexts = ImmutableList.copyOf(getLikeTextsInitialize());
likeTextsBuildStage = STAGE_INITIALIZED;
}
return this.likeTexts;
}
void likeTexts(ImmutableList likeTexts) {
this.likeTexts = likeTexts;
likeTextsBuildStage = STAGE_INITIALIZED;
}
private byte stopWordsBuildStage = STAGE_UNINITIALIZED;
private ImmutableSet stopWords;
ImmutableSet getStopWords() {
if (stopWordsBuildStage == STAGE_INITIALIZING) throw new IllegalStateException(formatInitCycleMessage());
if (stopWordsBuildStage == STAGE_UNINITIALIZED) {
stopWordsBuildStage = STAGE_INITIALIZING;
this.stopWords = ImmutableSet.copyOf(getStopWordsInitialize());
stopWordsBuildStage = STAGE_INITIALIZED;
}
return this.stopWords;
}
void stopWords(ImmutableSet stopWords) {
this.stopWords = stopWords;
stopWordsBuildStage = STAGE_INITIALIZED;
}
private byte unlikeItemsBuildStage = STAGE_UNINITIALIZED;
private ImmutableList unlikeItems;
ImmutableList getUnlikeItems() {
if (unlikeItemsBuildStage == STAGE_INITIALIZING) throw new IllegalStateException(formatInitCycleMessage());
if (unlikeItemsBuildStage == STAGE_UNINITIALIZED) {
unlikeItemsBuildStage = STAGE_INITIALIZING;
this.unlikeItems = ImmutableList.copyOf(getUnlikeItemsInitialize());
unlikeItemsBuildStage = STAGE_INITIALIZED;
}
return this.unlikeItems;
}
void unlikeItems(ImmutableList unlikeItems) {
this.unlikeItems = unlikeItems;
unlikeItemsBuildStage = STAGE_INITIALIZED;
}
private byte unlikeTextsBuildStage = STAGE_UNINITIALIZED;
private ImmutableList unlikeTexts;
ImmutableList getUnlikeTexts() {
if (unlikeTextsBuildStage == STAGE_INITIALIZING) throw new IllegalStateException(formatInitCycleMessage());
if (unlikeTextsBuildStage == STAGE_UNINITIALIZED) {
unlikeTextsBuildStage = STAGE_INITIALIZING;
this.unlikeTexts = ImmutableList.copyOf(getUnlikeTextsInitialize());
unlikeTextsBuildStage = STAGE_INITIALIZED;
}
return this.unlikeTexts;
}
void unlikeTexts(ImmutableList unlikeTexts) {
this.unlikeTexts = unlikeTexts;
unlikeTextsBuildStage = STAGE_INITIALIZED;
}
private String formatInitCycleMessage() {
List attributes = new ArrayList<>();
if (hasStandardDefaultsBuildStage == STAGE_INITIALIZING) attributes.add("hasStandardDefaults");
if (fieldsBuildStage == STAGE_INITIALIZING) attributes.add("fields");
if (likeItemsBuildStage == STAGE_INITIALIZING) attributes.add("likeItems");
if (likeTextsBuildStage == STAGE_INITIALIZING) attributes.add("likeTexts");
if (stopWordsBuildStage == STAGE_INITIALIZING) attributes.add("stopWords");
if (unlikeItemsBuildStage == STAGE_INITIALIZING) attributes.add("unlikeItems");
if (unlikeTextsBuildStage == STAGE_INITIALIZING) attributes.add("unlikeTexts");
return "Cannot build MoreLikeThisQuery, attribute initializers form cycle " + attributes;
}
}
private boolean hasStandardDefaultsInitialize() {
return MoreLikeThisQuery.super.hasStandardDefaults();
}
private Set getFieldsInitialize() {
return MoreLikeThisQuery.super.getFields();
}
private List getLikeItemsInitialize() {
return MoreLikeThisQuery.super.getLikeItems();
}
private List getLikeTextsInitialize() {
return MoreLikeThisQuery.super.getLikeTexts();
}
private Set getStopWordsInitialize() {
return MoreLikeThisQuery.super.getStopWords();
}
private List getUnlikeItemsInitialize() {
return MoreLikeThisQuery.super.getUnlikeItems();
}
private List getUnlikeTextsInitialize() {
return MoreLikeThisQuery.super.getUnlikeTexts();
}
/**
* @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;
}
/**
* Returns the analyzer that is used to analyze the free form text. Defaults to the analyzer
* associated with the first field in fields
* @return the analyzer that is used to analyze the free form text
*/
@JsonProperty("analyzer")
@Override
public @Nullable String getAnalyzer() {
return analyzer;
}
/**
* Returns the additional boost for each term in the formed query. Defaults to deactivated (0).
* Any other positive value activates terms boosting with the given boost factor.
* @return the additional boost for each term in the formed query
*/
@JsonProperty("boost_terms")
@Override
public @Nullable Float getBoostTerms() {
return boostTerms;
}
/**
* @return The value of the {@code fields} attribute
*/
@JsonProperty("fields")
@Override
public ImmutableSet getFields() {
InitShim shim = this.initShim;
return shim != null
? shim.getFields()
: this.fields;
}
/**
* @return The value of the {@code likeItems} attribute
*/
@JsonProperty("like_items")
@Override
public ImmutableList getLikeItems() {
InitShim shim = this.initShim;
return shim != null
? shim.getLikeItems()
: this.likeItems;
}
/**
* @return The value of the {@code likeTexts} attribute
*/
@JsonProperty("like_texts")
@Override
public ImmutableList getLikeTexts() {
InitShim shim = this.initShim;
return shim != null
? shim.getLikeTexts()
: this.likeTexts;
}
/**
* Returns the maximum document frequency above which the terms will be ignored from the input
* document. This could be useful in order to ignore highly frequent words such as stop words.
* Defaults to unbounded (0)
* @return the maximum document frequency above which the terms will be ignored from the input
* document
*/
@JsonProperty("max_doc_freq")
@Override
public @Nullable Integer getMaxDocFrequency() {
return maxDocFrequency;
}
/**
* Returns the maximum number of query terms that will be selected. Increasing this value gives
* greater accuracy at the expense of query execution speed. Defaults to 25.
* @return the maximum number of query terms that will be selected
*/
@JsonProperty("max_query_terms")
@Override
public @Nullable Integer getMaxQueryTerms() {
return maxQueryTerms;
}
/**
* Returns the maximum word length above which the terms will be ignored. Defaults to unbounded
* (0)
* @return the maximum word length above which the terms will be ignored
*/
@JsonProperty("max_word_length")
@Override
public @Nullable Integer getMaxWordLength() {
return maxWordLength;
}
/**
* Returns the minimum document frequency below which the terms will be ignored from the input
* document. Defaults to 5
* @return the minimum document frequency below which the terms will be ignored from the input
* document
*/
@JsonProperty("min_doc_freq")
@Override
public @Nullable Integer getMinDocFrequency() {
return minDocFrequency;
}
/**
* Returns the number of terms that must match after the disjunctive query has been formed. The
* syntax is the same as the minimum should match. (Defaults to "30%").
* @return the number of terms that must match after the disjunctive query has been formed
*/
@JsonProperty("minimum_should_match")
@Override
public @Nullable String getMinimumShouldMatch() {
return minimumShouldMatch;
}
/**
* Returns the minimum term frequency below which the terms will be ignored from the input
* document. Defaults to 2
* @return the minimum term frequency below which the terms will be ignored from the input
* document
*/
@JsonProperty("min_term_freq")
@Override
public @Nullable Integer getMinTermFrequency() {
return minTermFrequency;
}
/**
* Returns the minimum word length below which the terms will be ignored. Defaults to 0
* @return the minimum word length below which the terms will be ignored
*/
@JsonProperty("min_word_length")
@Override
public @Nullable Integer getMinWordLength() {
return minWordLength;
}
/**
* Returns an array of stop words. Any word in this set is considered "uninteresting" and
* ignored. If the analyzer allows for stop words, you might want to tell MLT to explicitly
* ignore them, as for the purposes of document similarity it seems reasonable to assume that "a
* stop word is never interesting".
* @return an array of stop words
*/
@JsonProperty("stop_words")
@Override
public ImmutableSet getStopWords() {
InitShim shim = this.initShim;
return shim != null
? shim.getStopWords()
: this.stopWords;
}
/**
* @return The value of the {@code unlikeItems} attribute
*/
@JsonProperty("unlike_items")
@Override
public ImmutableList getUnlikeItems() {
InitShim shim = this.initShim;
return shim != null
? shim.getUnlikeItems()
: this.unlikeItems;
}
/**
* @return The value of the {@code unlikeTexts} attribute
*/
@JsonProperty("unlike_texts")
@Override
public ImmutableList getUnlikeTexts() {
InitShim shim = this.initShim;
return shim != null
? shim.getUnlikeTexts()
: this.unlikeTexts;
}
/**
* Returns true if query should fail (throw an exception) if any of the specified fields are not
* of the supported types (text or keyword'). Set this to `false to ignore the field and
* continue processing. Defaults to true.
* @return true if query should fail if any of the specified fields are not of the supported
* types (text or keyword')
*/
@JsonProperty("fail_on_unsupported_field")
@Override
public @Nullable Boolean isFailOnUnsupportedField() {
return failOnUnsupportedField;
}
/**
* Returns whether the input documents should also be included in the search results returned.
* Defaults to false
* @return whether the input documents should also be included in the search results returned
*/
@JsonProperty("include")
@Override
public @Nullable Boolean isInclude() {
return include;
}
/**
* This instance is equal to all instances of {@code ImmutableMoreLikeThisQuery} 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 ImmutableMoreLikeThisQuery
&& equalTo((ImmutableMoreLikeThisQuery) another);
}
private boolean equalTo(ImmutableMoreLikeThisQuery another) {
return Objects.equals(boost, another.boost)
&& Objects.equals(name, another.name)
&& Objects.equals(analyzer, another.analyzer)
&& Objects.equals(boostTerms, another.boostTerms)
&& fields.equals(another.fields)
&& likeItems.equals(another.likeItems)
&& likeTexts.equals(another.likeTexts)
&& Objects.equals(maxDocFrequency, another.maxDocFrequency)
&& Objects.equals(maxQueryTerms, another.maxQueryTerms)
&& Objects.equals(maxWordLength, another.maxWordLength)
&& Objects.equals(minDocFrequency, another.minDocFrequency)
&& Objects.equals(minimumShouldMatch, another.minimumShouldMatch)
&& Objects.equals(minTermFrequency, another.minTermFrequency)
&& Objects.equals(minWordLength, another.minWordLength)
&& stopWords.equals(another.stopWords)
&& unlikeItems.equals(another.unlikeItems)
&& unlikeTexts.equals(another.unlikeTexts)
&& Objects.equals(failOnUnsupportedField, another.failOnUnsupportedField)
&& Objects.equals(include, another.include);
}
/**
* Computes a hash code from attributes: {@code boost}, {@code name}, {@code analyzer}, {@code boostTerms}, {@code fields}, {@code likeItems}, {@code likeTexts}, {@code maxDocFrequency}, {@code maxQueryTerms}, {@code maxWordLength}, {@code minDocFrequency}, {@code minimumShouldMatch}, {@code minTermFrequency}, {@code minWordLength}, {@code stopWords}, {@code unlikeItems}, {@code unlikeTexts}, {@code failOnUnsupportedField}, {@code include}.
* @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(boostTerms);
h += (h << 5) + fields.hashCode();
h += (h << 5) + likeItems.hashCode();
h += (h << 5) + likeTexts.hashCode();
h += (h << 5) + Objects.hashCode(maxDocFrequency);
h += (h << 5) + Objects.hashCode(maxQueryTerms);
h += (h << 5) + Objects.hashCode(maxWordLength);
h += (h << 5) + Objects.hashCode(minDocFrequency);
h += (h << 5) + Objects.hashCode(minimumShouldMatch);
h += (h << 5) + Objects.hashCode(minTermFrequency);
h += (h << 5) + Objects.hashCode(minWordLength);
h += (h << 5) + stopWords.hashCode();
h += (h << 5) + unlikeItems.hashCode();
h += (h << 5) + unlikeTexts.hashCode();
h += (h << 5) + Objects.hashCode(failOnUnsupportedField);
h += (h << 5) + Objects.hashCode(include);
return h;
}
/**
* Prints the immutable value {@code MoreLikeThisQuery} with attribute values.
* @return A string representation of the value
*/
@Override
public String toString() {
return MoreObjects.toStringHelper("MoreLikeThisQuery")
.omitNullValues()
.add("boost", boost)
.add("name", name)
.add("analyzer", analyzer)
.add("boostTerms", boostTerms)
.add("fields", fields)
.add("likeItems", likeItems)
.add("likeTexts", likeTexts)
.add("maxDocFrequency", maxDocFrequency)
.add("maxQueryTerms", maxQueryTerms)
.add("maxWordLength", maxWordLength)
.add("minDocFrequency", minDocFrequency)
.add("minimumShouldMatch", minimumShouldMatch)
.add("minTermFrequency", minTermFrequency)
.add("minWordLength", minWordLength)
.add("stopWords", stopWords)
.add("unlikeItems", unlikeItems)
.add("unlikeTexts", unlikeTexts)
.add("failOnUnsupportedField", failOnUnsupportedField)
.add("include", include)
.toString();
}
@SuppressWarnings("Immutable")
private transient volatile long lazyInitBitmap;
private static final long LIKE_LAZY_INIT_BIT = 0x1L;
@SuppressWarnings("Immutable")
private transient List