com.yelp.nrtsearch.server.grpc.FuzzyQuery Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of clientlib Show documentation
Show all versions of clientlib Show documentation
GRPC Clientlib for nrtSearch
The newest version!
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: yelp/nrtsearch/search.proto
// Protobuf Java Version: 3.25.3
package com.yelp.nrtsearch.server.grpc;
/**
*
* A query that matches documents containing terms similar to the specified term.
*
*
* Protobuf type {@code luceneserver.FuzzyQuery}
*/
public final class FuzzyQuery extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:luceneserver.FuzzyQuery)
FuzzyQueryOrBuilder {
private static final long serialVersionUID = 0L;
// Use FuzzyQuery.newBuilder() to construct.
private FuzzyQuery(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private FuzzyQuery() {
field_ = "";
text_ = "";
rewrite_ = 0;
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new FuzzyQuery();
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.yelp.nrtsearch.server.grpc.SearchResponseProto.internal_static_luceneserver_FuzzyQuery_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.yelp.nrtsearch.server.grpc.SearchResponseProto.internal_static_luceneserver_FuzzyQuery_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.yelp.nrtsearch.server.grpc.FuzzyQuery.class, com.yelp.nrtsearch.server.grpc.FuzzyQuery.Builder.class);
}
private int bitField0_;
public static final int FIELD_FIELD_NUMBER = 1;
@SuppressWarnings("serial")
private volatile java.lang.Object field_ = "";
/**
* string field = 1;
* @return The field.
*/
@java.lang.Override
public java.lang.String getField() {
java.lang.Object ref = field_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
field_ = s;
return s;
}
}
/**
* string field = 1;
* @return The bytes for field.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getFieldBytes() {
java.lang.Object ref = field_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
field_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int TEXT_FIELD_NUMBER = 2;
@SuppressWarnings("serial")
private volatile java.lang.Object text_ = "";
/**
* string text = 2;
* @return The text.
*/
@java.lang.Override
public java.lang.String getText() {
java.lang.Object ref = text_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
text_ = s;
return s;
}
}
/**
* string text = 2;
* @return The bytes for text.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getTextBytes() {
java.lang.Object ref = text_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
text_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int MAXEDITS_FIELD_NUMBER = 3;
private int maxEdits_ = 0;
/**
*
* The maximum allowed Levenshtein Edit Distance (or number of edits). Possible values are 0, 1 and 2. Either set this or auto. Default is 2.
*
*
* optional int32 maxEdits = 3;
* @return Whether the maxEdits field is set.
*/
@java.lang.Override
public boolean hasMaxEdits() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
*
* The maximum allowed Levenshtein Edit Distance (or number of edits). Possible values are 0, 1 and 2. Either set this or auto. Default is 2.
*
*
* optional int32 maxEdits = 3;
* @return The maxEdits.
*/
@java.lang.Override
public int getMaxEdits() {
return maxEdits_;
}
public static final int PREFIXLENGTH_FIELD_NUMBER = 4;
private int prefixLength_ = 0;
/**
*
* Length of common (non-fuzzy) prefix. Default is 0.
*
*
* optional int32 prefixLength = 4;
* @return Whether the prefixLength field is set.
*/
@java.lang.Override
public boolean hasPrefixLength() {
return ((bitField0_ & 0x00000002) != 0);
}
/**
*
* Length of common (non-fuzzy) prefix. Default is 0.
*
*
* optional int32 prefixLength = 4;
* @return The prefixLength.
*/
@java.lang.Override
public int getPrefixLength() {
return prefixLength_;
}
public static final int MAXEXPANSIONS_FIELD_NUMBER = 5;
private int maxExpansions_ = 0;
/**
*
* The maximum number of terms to match. Default is 50.
*
*
* optional int32 maxExpansions = 5;
* @return Whether the maxExpansions field is set.
*/
@java.lang.Override
public boolean hasMaxExpansions() {
return ((bitField0_ & 0x00000004) != 0);
}
/**
*
* The maximum number of terms to match. Default is 50.
*
*
* optional int32 maxExpansions = 5;
* @return The maxExpansions.
*/
@java.lang.Override
public int getMaxExpansions() {
return maxExpansions_;
}
public static final int TRANSPOSITIONS_FIELD_NUMBER = 6;
private boolean transpositions_ = false;
/**
*
* True if transpositions should be treated as a primitive edit operation. If this is false, comparisons will implement the classic Levenshtein algorithm. Default is true.
*
*
* optional bool transpositions = 6;
* @return Whether the transpositions field is set.
*/
@java.lang.Override
public boolean hasTranspositions() {
return ((bitField0_ & 0x00000008) != 0);
}
/**
*
* True if transpositions should be treated as a primitive edit operation. If this is false, comparisons will implement the classic Levenshtein algorithm. Default is true.
*
*
* optional bool transpositions = 6;
* @return The transpositions.
*/
@java.lang.Override
public boolean getTranspositions() {
return transpositions_;
}
public static final int REWRITE_FIELD_NUMBER = 7;
private int rewrite_ = 0;
/**
*
* Method used to rewrite the query.
*
*
* .luceneserver.RewriteMethod rewrite = 7;
* @return The enum numeric value on the wire for rewrite.
*/
@java.lang.Override public int getRewriteValue() {
return rewrite_;
}
/**
*
* Method used to rewrite the query.
*
*
* .luceneserver.RewriteMethod rewrite = 7;
* @return The rewrite.
*/
@java.lang.Override public com.yelp.nrtsearch.server.grpc.RewriteMethod getRewrite() {
com.yelp.nrtsearch.server.grpc.RewriteMethod result = com.yelp.nrtsearch.server.grpc.RewriteMethod.forNumber(rewrite_);
return result == null ? com.yelp.nrtsearch.server.grpc.RewriteMethod.UNRECOGNIZED : result;
}
public static final int REWRITETOPTERMSSIZE_FIELD_NUMBER = 8;
private int rewriteTopTermsSize_ = 0;
/**
*
* Specifies the size to use for the TOP_TERMS* rewrite methods.
*
*
* int32 rewriteTopTermsSize = 8;
* @return The rewriteTopTermsSize.
*/
@java.lang.Override
public int getRewriteTopTermsSize() {
return rewriteTopTermsSize_;
}
public static final int AUTO_FIELD_NUMBER = 9;
private com.yelp.nrtsearch.server.grpc.FuzzyParams.AutoFuzziness auto_;
/**
*
* Auto fuzziness which determines the max edits based on the term length. AUTO is the preferred setting. Either set this or maxEdits.
*
*
* .luceneserver.FuzzyParams.AutoFuzziness auto = 9;
* @return Whether the auto field is set.
*/
@java.lang.Override
public boolean hasAuto() {
return ((bitField0_ & 0x00000010) != 0);
}
/**
*
* Auto fuzziness which determines the max edits based on the term length. AUTO is the preferred setting. Either set this or maxEdits.
*
*
* .luceneserver.FuzzyParams.AutoFuzziness auto = 9;
* @return The auto.
*/
@java.lang.Override
public com.yelp.nrtsearch.server.grpc.FuzzyParams.AutoFuzziness getAuto() {
return auto_ == null ? com.yelp.nrtsearch.server.grpc.FuzzyParams.AutoFuzziness.getDefaultInstance() : auto_;
}
/**
*
* Auto fuzziness which determines the max edits based on the term length. AUTO is the preferred setting. Either set this or maxEdits.
*
*
* .luceneserver.FuzzyParams.AutoFuzziness auto = 9;
*/
@java.lang.Override
public com.yelp.nrtsearch.server.grpc.FuzzyParams.AutoFuzzinessOrBuilder getAutoOrBuilder() {
return auto_ == null ? com.yelp.nrtsearch.server.grpc.FuzzyParams.AutoFuzziness.getDefaultInstance() : auto_;
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(field_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, field_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(text_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 2, text_);
}
if (((bitField0_ & 0x00000001) != 0)) {
output.writeInt32(3, maxEdits_);
}
if (((bitField0_ & 0x00000002) != 0)) {
output.writeInt32(4, prefixLength_);
}
if (((bitField0_ & 0x00000004) != 0)) {
output.writeInt32(5, maxExpansions_);
}
if (((bitField0_ & 0x00000008) != 0)) {
output.writeBool(6, transpositions_);
}
if (rewrite_ != com.yelp.nrtsearch.server.grpc.RewriteMethod.CONSTANT_SCORE.getNumber()) {
output.writeEnum(7, rewrite_);
}
if (rewriteTopTermsSize_ != 0) {
output.writeInt32(8, rewriteTopTermsSize_);
}
if (((bitField0_ & 0x00000010) != 0)) {
output.writeMessage(9, getAuto());
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(field_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, field_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(text_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, text_);
}
if (((bitField0_ & 0x00000001) != 0)) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(3, maxEdits_);
}
if (((bitField0_ & 0x00000002) != 0)) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(4, prefixLength_);
}
if (((bitField0_ & 0x00000004) != 0)) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(5, maxExpansions_);
}
if (((bitField0_ & 0x00000008) != 0)) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(6, transpositions_);
}
if (rewrite_ != com.yelp.nrtsearch.server.grpc.RewriteMethod.CONSTANT_SCORE.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(7, rewrite_);
}
if (rewriteTopTermsSize_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(8, rewriteTopTermsSize_);
}
if (((bitField0_ & 0x00000010) != 0)) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(9, getAuto());
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof com.yelp.nrtsearch.server.grpc.FuzzyQuery)) {
return super.equals(obj);
}
com.yelp.nrtsearch.server.grpc.FuzzyQuery other = (com.yelp.nrtsearch.server.grpc.FuzzyQuery) obj;
if (!getField()
.equals(other.getField())) return false;
if (!getText()
.equals(other.getText())) return false;
if (hasMaxEdits() != other.hasMaxEdits()) return false;
if (hasMaxEdits()) {
if (getMaxEdits()
!= other.getMaxEdits()) return false;
}
if (hasPrefixLength() != other.hasPrefixLength()) return false;
if (hasPrefixLength()) {
if (getPrefixLength()
!= other.getPrefixLength()) return false;
}
if (hasMaxExpansions() != other.hasMaxExpansions()) return false;
if (hasMaxExpansions()) {
if (getMaxExpansions()
!= other.getMaxExpansions()) return false;
}
if (hasTranspositions() != other.hasTranspositions()) return false;
if (hasTranspositions()) {
if (getTranspositions()
!= other.getTranspositions()) return false;
}
if (rewrite_ != other.rewrite_) return false;
if (getRewriteTopTermsSize()
!= other.getRewriteTopTermsSize()) return false;
if (hasAuto() != other.hasAuto()) return false;
if (hasAuto()) {
if (!getAuto()
.equals(other.getAuto())) return false;
}
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + FIELD_FIELD_NUMBER;
hash = (53 * hash) + getField().hashCode();
hash = (37 * hash) + TEXT_FIELD_NUMBER;
hash = (53 * hash) + getText().hashCode();
if (hasMaxEdits()) {
hash = (37 * hash) + MAXEDITS_FIELD_NUMBER;
hash = (53 * hash) + getMaxEdits();
}
if (hasPrefixLength()) {
hash = (37 * hash) + PREFIXLENGTH_FIELD_NUMBER;
hash = (53 * hash) + getPrefixLength();
}
if (hasMaxExpansions()) {
hash = (37 * hash) + MAXEXPANSIONS_FIELD_NUMBER;
hash = (53 * hash) + getMaxExpansions();
}
if (hasTranspositions()) {
hash = (37 * hash) + TRANSPOSITIONS_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
getTranspositions());
}
hash = (37 * hash) + REWRITE_FIELD_NUMBER;
hash = (53 * hash) + rewrite_;
hash = (37 * hash) + REWRITETOPTERMSSIZE_FIELD_NUMBER;
hash = (53 * hash) + getRewriteTopTermsSize();
if (hasAuto()) {
hash = (37 * hash) + AUTO_FIELD_NUMBER;
hash = (53 * hash) + getAuto().hashCode();
}
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.yelp.nrtsearch.server.grpc.FuzzyQuery parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.yelp.nrtsearch.server.grpc.FuzzyQuery parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.yelp.nrtsearch.server.grpc.FuzzyQuery parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.yelp.nrtsearch.server.grpc.FuzzyQuery parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.yelp.nrtsearch.server.grpc.FuzzyQuery parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.yelp.nrtsearch.server.grpc.FuzzyQuery parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.yelp.nrtsearch.server.grpc.FuzzyQuery parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.yelp.nrtsearch.server.grpc.FuzzyQuery parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static com.yelp.nrtsearch.server.grpc.FuzzyQuery parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static com.yelp.nrtsearch.server.grpc.FuzzyQuery parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static com.yelp.nrtsearch.server.grpc.FuzzyQuery parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.yelp.nrtsearch.server.grpc.FuzzyQuery parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(com.yelp.nrtsearch.server.grpc.FuzzyQuery prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
* A query that matches documents containing terms similar to the specified term.
*
*
* Protobuf type {@code luceneserver.FuzzyQuery}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:luceneserver.FuzzyQuery)
com.yelp.nrtsearch.server.grpc.FuzzyQueryOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.yelp.nrtsearch.server.grpc.SearchResponseProto.internal_static_luceneserver_FuzzyQuery_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.yelp.nrtsearch.server.grpc.SearchResponseProto.internal_static_luceneserver_FuzzyQuery_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.yelp.nrtsearch.server.grpc.FuzzyQuery.class, com.yelp.nrtsearch.server.grpc.FuzzyQuery.Builder.class);
}
// Construct using com.yelp.nrtsearch.server.grpc.FuzzyQuery.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
getAutoFieldBuilder();
}
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
field_ = "";
text_ = "";
maxEdits_ = 0;
prefixLength_ = 0;
maxExpansions_ = 0;
transpositions_ = false;
rewrite_ = 0;
rewriteTopTermsSize_ = 0;
auto_ = null;
if (autoBuilder_ != null) {
autoBuilder_.dispose();
autoBuilder_ = null;
}
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.yelp.nrtsearch.server.grpc.SearchResponseProto.internal_static_luceneserver_FuzzyQuery_descriptor;
}
@java.lang.Override
public com.yelp.nrtsearch.server.grpc.FuzzyQuery getDefaultInstanceForType() {
return com.yelp.nrtsearch.server.grpc.FuzzyQuery.getDefaultInstance();
}
@java.lang.Override
public com.yelp.nrtsearch.server.grpc.FuzzyQuery build() {
com.yelp.nrtsearch.server.grpc.FuzzyQuery result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.yelp.nrtsearch.server.grpc.FuzzyQuery buildPartial() {
com.yelp.nrtsearch.server.grpc.FuzzyQuery result = new com.yelp.nrtsearch.server.grpc.FuzzyQuery(this);
if (bitField0_ != 0) { buildPartial0(result); }
onBuilt();
return result;
}
private void buildPartial0(com.yelp.nrtsearch.server.grpc.FuzzyQuery result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.field_ = field_;
}
if (((from_bitField0_ & 0x00000002) != 0)) {
result.text_ = text_;
}
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000004) != 0)) {
result.maxEdits_ = maxEdits_;
to_bitField0_ |= 0x00000001;
}
if (((from_bitField0_ & 0x00000008) != 0)) {
result.prefixLength_ = prefixLength_;
to_bitField0_ |= 0x00000002;
}
if (((from_bitField0_ & 0x00000010) != 0)) {
result.maxExpansions_ = maxExpansions_;
to_bitField0_ |= 0x00000004;
}
if (((from_bitField0_ & 0x00000020) != 0)) {
result.transpositions_ = transpositions_;
to_bitField0_ |= 0x00000008;
}
if (((from_bitField0_ & 0x00000040) != 0)) {
result.rewrite_ = rewrite_;
}
if (((from_bitField0_ & 0x00000080) != 0)) {
result.rewriteTopTermsSize_ = rewriteTopTermsSize_;
}
if (((from_bitField0_ & 0x00000100) != 0)) {
result.auto_ = autoBuilder_ == null
? auto_
: autoBuilder_.build();
to_bitField0_ |= 0x00000010;
}
result.bitField0_ |= to_bitField0_;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.yelp.nrtsearch.server.grpc.FuzzyQuery) {
return mergeFrom((com.yelp.nrtsearch.server.grpc.FuzzyQuery)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.yelp.nrtsearch.server.grpc.FuzzyQuery other) {
if (other == com.yelp.nrtsearch.server.grpc.FuzzyQuery.getDefaultInstance()) return this;
if (!other.getField().isEmpty()) {
field_ = other.field_;
bitField0_ |= 0x00000001;
onChanged();
}
if (!other.getText().isEmpty()) {
text_ = other.text_;
bitField0_ |= 0x00000002;
onChanged();
}
if (other.hasMaxEdits()) {
setMaxEdits(other.getMaxEdits());
}
if (other.hasPrefixLength()) {
setPrefixLength(other.getPrefixLength());
}
if (other.hasMaxExpansions()) {
setMaxExpansions(other.getMaxExpansions());
}
if (other.hasTranspositions()) {
setTranspositions(other.getTranspositions());
}
if (other.rewrite_ != 0) {
setRewriteValue(other.getRewriteValue());
}
if (other.getRewriteTopTermsSize() != 0) {
setRewriteTopTermsSize(other.getRewriteTopTermsSize());
}
if (other.hasAuto()) {
mergeAuto(other.getAuto());
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
field_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000001;
break;
} // case 10
case 18: {
text_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000002;
break;
} // case 18
case 24: {
maxEdits_ = input.readInt32();
bitField0_ |= 0x00000004;
break;
} // case 24
case 32: {
prefixLength_ = input.readInt32();
bitField0_ |= 0x00000008;
break;
} // case 32
case 40: {
maxExpansions_ = input.readInt32();
bitField0_ |= 0x00000010;
break;
} // case 40
case 48: {
transpositions_ = input.readBool();
bitField0_ |= 0x00000020;
break;
} // case 48
case 56: {
rewrite_ = input.readEnum();
bitField0_ |= 0x00000040;
break;
} // case 56
case 64: {
rewriteTopTermsSize_ = input.readInt32();
bitField0_ |= 0x00000080;
break;
} // case 64
case 74: {
input.readMessage(
getAutoFieldBuilder().getBuilder(),
extensionRegistry);
bitField0_ |= 0x00000100;
break;
} // case 74
default: {
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private java.lang.Object field_ = "";
/**
* string field = 1;
* @return The field.
*/
public java.lang.String getField() {
java.lang.Object ref = field_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
field_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* string field = 1;
* @return The bytes for field.
*/
public com.google.protobuf.ByteString
getFieldBytes() {
java.lang.Object ref = field_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
field_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* string field = 1;
* @param value The field to set.
* @return This builder for chaining.
*/
public Builder setField(
java.lang.String value) {
if (value == null) { throw new NullPointerException(); }
field_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
* string field = 1;
* @return This builder for chaining.
*/
public Builder clearField() {
field_ = getDefaultInstance().getField();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
return this;
}
/**
* string field = 1;
* @param value The bytes for field to set.
* @return This builder for chaining.
*/
public Builder setFieldBytes(
com.google.protobuf.ByteString value) {
if (value == null) { throw new NullPointerException(); }
checkByteStringIsUtf8(value);
field_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
private java.lang.Object text_ = "";
/**
* string text = 2;
* @return The text.
*/
public java.lang.String getText() {
java.lang.Object ref = text_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
text_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* string text = 2;
* @return The bytes for text.
*/
public com.google.protobuf.ByteString
getTextBytes() {
java.lang.Object ref = text_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
text_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* string text = 2;
* @param value The text to set.
* @return This builder for chaining.
*/
public Builder setText(
java.lang.String value) {
if (value == null) { throw new NullPointerException(); }
text_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
* string text = 2;
* @return This builder for chaining.
*/
public Builder clearText() {
text_ = getDefaultInstance().getText();
bitField0_ = (bitField0_ & ~0x00000002);
onChanged();
return this;
}
/**
* string text = 2;
* @param value The bytes for text to set.
* @return This builder for chaining.
*/
public Builder setTextBytes(
com.google.protobuf.ByteString value) {
if (value == null) { throw new NullPointerException(); }
checkByteStringIsUtf8(value);
text_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
private int maxEdits_ ;
/**
*
* The maximum allowed Levenshtein Edit Distance (or number of edits). Possible values are 0, 1 and 2. Either set this or auto. Default is 2.
*
*
* optional int32 maxEdits = 3;
* @return Whether the maxEdits field is set.
*/
@java.lang.Override
public boolean hasMaxEdits() {
return ((bitField0_ & 0x00000004) != 0);
}
/**
*
* The maximum allowed Levenshtein Edit Distance (or number of edits). Possible values are 0, 1 and 2. Either set this or auto. Default is 2.
*
*
* optional int32 maxEdits = 3;
* @return The maxEdits.
*/
@java.lang.Override
public int getMaxEdits() {
return maxEdits_;
}
/**
*
* The maximum allowed Levenshtein Edit Distance (or number of edits). Possible values are 0, 1 and 2. Either set this or auto. Default is 2.
*
*
* optional int32 maxEdits = 3;
* @param value The maxEdits to set.
* @return This builder for chaining.
*/
public Builder setMaxEdits(int value) {
maxEdits_ = value;
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
*
* The maximum allowed Levenshtein Edit Distance (or number of edits). Possible values are 0, 1 and 2. Either set this or auto. Default is 2.
*
*
* optional int32 maxEdits = 3;
* @return This builder for chaining.
*/
public Builder clearMaxEdits() {
bitField0_ = (bitField0_ & ~0x00000004);
maxEdits_ = 0;
onChanged();
return this;
}
private int prefixLength_ ;
/**
*
* Length of common (non-fuzzy) prefix. Default is 0.
*
*
* optional int32 prefixLength = 4;
* @return Whether the prefixLength field is set.
*/
@java.lang.Override
public boolean hasPrefixLength() {
return ((bitField0_ & 0x00000008) != 0);
}
/**
*
* Length of common (non-fuzzy) prefix. Default is 0.
*
*
* optional int32 prefixLength = 4;
* @return The prefixLength.
*/
@java.lang.Override
public int getPrefixLength() {
return prefixLength_;
}
/**
*
* Length of common (non-fuzzy) prefix. Default is 0.
*
*
* optional int32 prefixLength = 4;
* @param value The prefixLength to set.
* @return This builder for chaining.
*/
public Builder setPrefixLength(int value) {
prefixLength_ = value;
bitField0_ |= 0x00000008;
onChanged();
return this;
}
/**
*
* Length of common (non-fuzzy) prefix. Default is 0.
*
*
* optional int32 prefixLength = 4;
* @return This builder for chaining.
*/
public Builder clearPrefixLength() {
bitField0_ = (bitField0_ & ~0x00000008);
prefixLength_ = 0;
onChanged();
return this;
}
private int maxExpansions_ ;
/**
*
* The maximum number of terms to match. Default is 50.
*
*
* optional int32 maxExpansions = 5;
* @return Whether the maxExpansions field is set.
*/
@java.lang.Override
public boolean hasMaxExpansions() {
return ((bitField0_ & 0x00000010) != 0);
}
/**
*
* The maximum number of terms to match. Default is 50.
*
*
* optional int32 maxExpansions = 5;
* @return The maxExpansions.
*/
@java.lang.Override
public int getMaxExpansions() {
return maxExpansions_;
}
/**
*
* The maximum number of terms to match. Default is 50.
*
*
* optional int32 maxExpansions = 5;
* @param value The maxExpansions to set.
* @return This builder for chaining.
*/
public Builder setMaxExpansions(int value) {
maxExpansions_ = value;
bitField0_ |= 0x00000010;
onChanged();
return this;
}
/**
*
* The maximum number of terms to match. Default is 50.
*
*
* optional int32 maxExpansions = 5;
* @return This builder for chaining.
*/
public Builder clearMaxExpansions() {
bitField0_ = (bitField0_ & ~0x00000010);
maxExpansions_ = 0;
onChanged();
return this;
}
private boolean transpositions_ ;
/**
*
* True if transpositions should be treated as a primitive edit operation. If this is false, comparisons will implement the classic Levenshtein algorithm. Default is true.
*
*
* optional bool transpositions = 6;
* @return Whether the transpositions field is set.
*/
@java.lang.Override
public boolean hasTranspositions() {
return ((bitField0_ & 0x00000020) != 0);
}
/**
*
* True if transpositions should be treated as a primitive edit operation. If this is false, comparisons will implement the classic Levenshtein algorithm. Default is true.
*
*
* optional bool transpositions = 6;
* @return The transpositions.
*/
@java.lang.Override
public boolean getTranspositions() {
return transpositions_;
}
/**
*
* True if transpositions should be treated as a primitive edit operation. If this is false, comparisons will implement the classic Levenshtein algorithm. Default is true.
*
*
* optional bool transpositions = 6;
* @param value The transpositions to set.
* @return This builder for chaining.
*/
public Builder setTranspositions(boolean value) {
transpositions_ = value;
bitField0_ |= 0x00000020;
onChanged();
return this;
}
/**
*
* True if transpositions should be treated as a primitive edit operation. If this is false, comparisons will implement the classic Levenshtein algorithm. Default is true.
*
*
* optional bool transpositions = 6;
* @return This builder for chaining.
*/
public Builder clearTranspositions() {
bitField0_ = (bitField0_ & ~0x00000020);
transpositions_ = false;
onChanged();
return this;
}
private int rewrite_ = 0;
/**
*
* Method used to rewrite the query.
*
*
* .luceneserver.RewriteMethod rewrite = 7;
* @return The enum numeric value on the wire for rewrite.
*/
@java.lang.Override public int getRewriteValue() {
return rewrite_;
}
/**
*
* Method used to rewrite the query.
*
*
* .luceneserver.RewriteMethod rewrite = 7;
* @param value The enum numeric value on the wire for rewrite to set.
* @return This builder for chaining.
*/
public Builder setRewriteValue(int value) {
rewrite_ = value;
bitField0_ |= 0x00000040;
onChanged();
return this;
}
/**
*
* Method used to rewrite the query.
*
*
* .luceneserver.RewriteMethod rewrite = 7;
* @return The rewrite.
*/
@java.lang.Override
public com.yelp.nrtsearch.server.grpc.RewriteMethod getRewrite() {
com.yelp.nrtsearch.server.grpc.RewriteMethod result = com.yelp.nrtsearch.server.grpc.RewriteMethod.forNumber(rewrite_);
return result == null ? com.yelp.nrtsearch.server.grpc.RewriteMethod.UNRECOGNIZED : result;
}
/**
*
* Method used to rewrite the query.
*
*
* .luceneserver.RewriteMethod rewrite = 7;
* @param value The rewrite to set.
* @return This builder for chaining.
*/
public Builder setRewrite(com.yelp.nrtsearch.server.grpc.RewriteMethod value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000040;
rewrite_ = value.getNumber();
onChanged();
return this;
}
/**
*
* Method used to rewrite the query.
*
*
* .luceneserver.RewriteMethod rewrite = 7;
* @return This builder for chaining.
*/
public Builder clearRewrite() {
bitField0_ = (bitField0_ & ~0x00000040);
rewrite_ = 0;
onChanged();
return this;
}
private int rewriteTopTermsSize_ ;
/**
*
* Specifies the size to use for the TOP_TERMS* rewrite methods.
*
*
* int32 rewriteTopTermsSize = 8;
* @return The rewriteTopTermsSize.
*/
@java.lang.Override
public int getRewriteTopTermsSize() {
return rewriteTopTermsSize_;
}
/**
*
* Specifies the size to use for the TOP_TERMS* rewrite methods.
*
*
* int32 rewriteTopTermsSize = 8;
* @param value The rewriteTopTermsSize to set.
* @return This builder for chaining.
*/
public Builder setRewriteTopTermsSize(int value) {
rewriteTopTermsSize_ = value;
bitField0_ |= 0x00000080;
onChanged();
return this;
}
/**
*
* Specifies the size to use for the TOP_TERMS* rewrite methods.
*
*
* int32 rewriteTopTermsSize = 8;
* @return This builder for chaining.
*/
public Builder clearRewriteTopTermsSize() {
bitField0_ = (bitField0_ & ~0x00000080);
rewriteTopTermsSize_ = 0;
onChanged();
return this;
}
private com.yelp.nrtsearch.server.grpc.FuzzyParams.AutoFuzziness auto_;
private com.google.protobuf.SingleFieldBuilderV3<
com.yelp.nrtsearch.server.grpc.FuzzyParams.AutoFuzziness, com.yelp.nrtsearch.server.grpc.FuzzyParams.AutoFuzziness.Builder, com.yelp.nrtsearch.server.grpc.FuzzyParams.AutoFuzzinessOrBuilder> autoBuilder_;
/**
*
* Auto fuzziness which determines the max edits based on the term length. AUTO is the preferred setting. Either set this or maxEdits.
*
*
* .luceneserver.FuzzyParams.AutoFuzziness auto = 9;
* @return Whether the auto field is set.
*/
public boolean hasAuto() {
return ((bitField0_ & 0x00000100) != 0);
}
/**
*
* Auto fuzziness which determines the max edits based on the term length. AUTO is the preferred setting. Either set this or maxEdits.
*
*
* .luceneserver.FuzzyParams.AutoFuzziness auto = 9;
* @return The auto.
*/
public com.yelp.nrtsearch.server.grpc.FuzzyParams.AutoFuzziness getAuto() {
if (autoBuilder_ == null) {
return auto_ == null ? com.yelp.nrtsearch.server.grpc.FuzzyParams.AutoFuzziness.getDefaultInstance() : auto_;
} else {
return autoBuilder_.getMessage();
}
}
/**
*
* Auto fuzziness which determines the max edits based on the term length. AUTO is the preferred setting. Either set this or maxEdits.
*
*
* .luceneserver.FuzzyParams.AutoFuzziness auto = 9;
*/
public Builder setAuto(com.yelp.nrtsearch.server.grpc.FuzzyParams.AutoFuzziness value) {
if (autoBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
auto_ = value;
} else {
autoBuilder_.setMessage(value);
}
bitField0_ |= 0x00000100;
onChanged();
return this;
}
/**
*
* Auto fuzziness which determines the max edits based on the term length. AUTO is the preferred setting. Either set this or maxEdits.
*
*
* .luceneserver.FuzzyParams.AutoFuzziness auto = 9;
*/
public Builder setAuto(
com.yelp.nrtsearch.server.grpc.FuzzyParams.AutoFuzziness.Builder builderForValue) {
if (autoBuilder_ == null) {
auto_ = builderForValue.build();
} else {
autoBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000100;
onChanged();
return this;
}
/**
*
* Auto fuzziness which determines the max edits based on the term length. AUTO is the preferred setting. Either set this or maxEdits.
*
*
* .luceneserver.FuzzyParams.AutoFuzziness auto = 9;
*/
public Builder mergeAuto(com.yelp.nrtsearch.server.grpc.FuzzyParams.AutoFuzziness value) {
if (autoBuilder_ == null) {
if (((bitField0_ & 0x00000100) != 0) &&
auto_ != null &&
auto_ != com.yelp.nrtsearch.server.grpc.FuzzyParams.AutoFuzziness.getDefaultInstance()) {
getAutoBuilder().mergeFrom(value);
} else {
auto_ = value;
}
} else {
autoBuilder_.mergeFrom(value);
}
if (auto_ != null) {
bitField0_ |= 0x00000100;
onChanged();
}
return this;
}
/**
*
* Auto fuzziness which determines the max edits based on the term length. AUTO is the preferred setting. Either set this or maxEdits.
*
*
* .luceneserver.FuzzyParams.AutoFuzziness auto = 9;
*/
public Builder clearAuto() {
bitField0_ = (bitField0_ & ~0x00000100);
auto_ = null;
if (autoBuilder_ != null) {
autoBuilder_.dispose();
autoBuilder_ = null;
}
onChanged();
return this;
}
/**
*
* Auto fuzziness which determines the max edits based on the term length. AUTO is the preferred setting. Either set this or maxEdits.
*
*
* .luceneserver.FuzzyParams.AutoFuzziness auto = 9;
*/
public com.yelp.nrtsearch.server.grpc.FuzzyParams.AutoFuzziness.Builder getAutoBuilder() {
bitField0_ |= 0x00000100;
onChanged();
return getAutoFieldBuilder().getBuilder();
}
/**
*
* Auto fuzziness which determines the max edits based on the term length. AUTO is the preferred setting. Either set this or maxEdits.
*
*
* .luceneserver.FuzzyParams.AutoFuzziness auto = 9;
*/
public com.yelp.nrtsearch.server.grpc.FuzzyParams.AutoFuzzinessOrBuilder getAutoOrBuilder() {
if (autoBuilder_ != null) {
return autoBuilder_.getMessageOrBuilder();
} else {
return auto_ == null ?
com.yelp.nrtsearch.server.grpc.FuzzyParams.AutoFuzziness.getDefaultInstance() : auto_;
}
}
/**
*
* Auto fuzziness which determines the max edits based on the term length. AUTO is the preferred setting. Either set this or maxEdits.
*
*
* .luceneserver.FuzzyParams.AutoFuzziness auto = 9;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.yelp.nrtsearch.server.grpc.FuzzyParams.AutoFuzziness, com.yelp.nrtsearch.server.grpc.FuzzyParams.AutoFuzziness.Builder, com.yelp.nrtsearch.server.grpc.FuzzyParams.AutoFuzzinessOrBuilder>
getAutoFieldBuilder() {
if (autoBuilder_ == null) {
autoBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
com.yelp.nrtsearch.server.grpc.FuzzyParams.AutoFuzziness, com.yelp.nrtsearch.server.grpc.FuzzyParams.AutoFuzziness.Builder, com.yelp.nrtsearch.server.grpc.FuzzyParams.AutoFuzzinessOrBuilder>(
getAuto(),
getParentForChildren(),
isClean());
auto_ = null;
}
return autoBuilder_;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:luceneserver.FuzzyQuery)
}
// @@protoc_insertion_point(class_scope:luceneserver.FuzzyQuery)
private static final com.yelp.nrtsearch.server.grpc.FuzzyQuery DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.yelp.nrtsearch.server.grpc.FuzzyQuery();
}
public static com.yelp.nrtsearch.server.grpc.FuzzyQuery getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public FuzzyQuery parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public com.yelp.nrtsearch.server.grpc.FuzzyQuery getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}