com.yelp.nrtsearch.server.grpc.Rescorer 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
// 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;
/**
*
* Defines a rescorer which is executed after the first search pass
*
*
* Protobuf type {@code luceneserver.Rescorer}
*/
public final class Rescorer extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:luceneserver.Rescorer)
RescorerOrBuilder {
private static final long serialVersionUID = 0L;
// Use Rescorer.newBuilder() to construct.
private Rescorer(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private Rescorer() {
name_ = "";
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new Rescorer();
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.yelp.nrtsearch.server.grpc.SearchResponseProto.internal_static_luceneserver_Rescorer_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.yelp.nrtsearch.server.grpc.SearchResponseProto.internal_static_luceneserver_Rescorer_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.yelp.nrtsearch.server.grpc.Rescorer.class, com.yelp.nrtsearch.server.grpc.Rescorer.Builder.class);
}
private int rescorersCase_ = 0;
@SuppressWarnings("serial")
private java.lang.Object rescorers_;
public enum RescorersCase
implements com.google.protobuf.Internal.EnumLite,
com.google.protobuf.AbstractMessage.InternalOneOfEnum {
QUERYRESCORER(2),
PLUGINRESCORER(3),
RESCORERS_NOT_SET(0);
private final int value;
private RescorersCase(int value) {
this.value = value;
}
/**
* @param value The number of the enum to look for.
* @return The enum associated with the given number.
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static RescorersCase valueOf(int value) {
return forNumber(value);
}
public static RescorersCase forNumber(int value) {
switch (value) {
case 2: return QUERYRESCORER;
case 3: return PLUGINRESCORER;
case 0: return RESCORERS_NOT_SET;
default: return null;
}
}
public int getNumber() {
return this.value;
}
};
public RescorersCase
getRescorersCase() {
return RescorersCase.forNumber(
rescorersCase_);
}
public static final int WINDOWSIZE_FIELD_NUMBER = 1;
private int windowSize_ = 0;
/**
* int32 windowSize = 1;
* @return The windowSize.
*/
@java.lang.Override
public int getWindowSize() {
return windowSize_;
}
public static final int QUERYRESCORER_FIELD_NUMBER = 2;
/**
* .luceneserver.QueryRescorer queryRescorer = 2;
* @return Whether the queryRescorer field is set.
*/
@java.lang.Override
public boolean hasQueryRescorer() {
return rescorersCase_ == 2;
}
/**
* .luceneserver.QueryRescorer queryRescorer = 2;
* @return The queryRescorer.
*/
@java.lang.Override
public com.yelp.nrtsearch.server.grpc.QueryRescorer getQueryRescorer() {
if (rescorersCase_ == 2) {
return (com.yelp.nrtsearch.server.grpc.QueryRescorer) rescorers_;
}
return com.yelp.nrtsearch.server.grpc.QueryRescorer.getDefaultInstance();
}
/**
* .luceneserver.QueryRescorer queryRescorer = 2;
*/
@java.lang.Override
public com.yelp.nrtsearch.server.grpc.QueryRescorerOrBuilder getQueryRescorerOrBuilder() {
if (rescorersCase_ == 2) {
return (com.yelp.nrtsearch.server.grpc.QueryRescorer) rescorers_;
}
return com.yelp.nrtsearch.server.grpc.QueryRescorer.getDefaultInstance();
}
public static final int PLUGINRESCORER_FIELD_NUMBER = 3;
/**
* .luceneserver.PluginRescorer pluginRescorer = 3;
* @return Whether the pluginRescorer field is set.
*/
@java.lang.Override
public boolean hasPluginRescorer() {
return rescorersCase_ == 3;
}
/**
* .luceneserver.PluginRescorer pluginRescorer = 3;
* @return The pluginRescorer.
*/
@java.lang.Override
public com.yelp.nrtsearch.server.grpc.PluginRescorer getPluginRescorer() {
if (rescorersCase_ == 3) {
return (com.yelp.nrtsearch.server.grpc.PluginRescorer) rescorers_;
}
return com.yelp.nrtsearch.server.grpc.PluginRescorer.getDefaultInstance();
}
/**
* .luceneserver.PluginRescorer pluginRescorer = 3;
*/
@java.lang.Override
public com.yelp.nrtsearch.server.grpc.PluginRescorerOrBuilder getPluginRescorerOrBuilder() {
if (rescorersCase_ == 3) {
return (com.yelp.nrtsearch.server.grpc.PluginRescorer) rescorers_;
}
return com.yelp.nrtsearch.server.grpc.PluginRescorer.getDefaultInstance();
}
public static final int NAME_FIELD_NUMBER = 4;
@SuppressWarnings("serial")
private volatile java.lang.Object name_ = "";
/**
*
* Must be unique for each Rescorer
*
*
* string name = 4;
* @return The name.
*/
@java.lang.Override
public java.lang.String getName() {
java.lang.Object ref = name_;
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();
name_ = s;
return s;
}
}
/**
*
* Must be unique for each Rescorer
*
*
* string name = 4;
* @return The bytes for name.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getNameBytes() {
java.lang.Object ref = name_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
name_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
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 (windowSize_ != 0) {
output.writeInt32(1, windowSize_);
}
if (rescorersCase_ == 2) {
output.writeMessage(2, (com.yelp.nrtsearch.server.grpc.QueryRescorer) rescorers_);
}
if (rescorersCase_ == 3) {
output.writeMessage(3, (com.yelp.nrtsearch.server.grpc.PluginRescorer) rescorers_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 4, name_);
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (windowSize_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(1, windowSize_);
}
if (rescorersCase_ == 2) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, (com.yelp.nrtsearch.server.grpc.QueryRescorer) rescorers_);
}
if (rescorersCase_ == 3) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(3, (com.yelp.nrtsearch.server.grpc.PluginRescorer) rescorers_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, name_);
}
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.Rescorer)) {
return super.equals(obj);
}
com.yelp.nrtsearch.server.grpc.Rescorer other = (com.yelp.nrtsearch.server.grpc.Rescorer) obj;
if (getWindowSize()
!= other.getWindowSize()) return false;
if (!getName()
.equals(other.getName())) return false;
if (!getRescorersCase().equals(other.getRescorersCase())) return false;
switch (rescorersCase_) {
case 2:
if (!getQueryRescorer()
.equals(other.getQueryRescorer())) return false;
break;
case 3:
if (!getPluginRescorer()
.equals(other.getPluginRescorer())) return false;
break;
case 0:
default:
}
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) + WINDOWSIZE_FIELD_NUMBER;
hash = (53 * hash) + getWindowSize();
hash = (37 * hash) + NAME_FIELD_NUMBER;
hash = (53 * hash) + getName().hashCode();
switch (rescorersCase_) {
case 2:
hash = (37 * hash) + QUERYRESCORER_FIELD_NUMBER;
hash = (53 * hash) + getQueryRescorer().hashCode();
break;
case 3:
hash = (37 * hash) + PLUGINRESCORER_FIELD_NUMBER;
hash = (53 * hash) + getPluginRescorer().hashCode();
break;
case 0:
default:
}
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.yelp.nrtsearch.server.grpc.Rescorer parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.yelp.nrtsearch.server.grpc.Rescorer 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.Rescorer parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.yelp.nrtsearch.server.grpc.Rescorer 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.Rescorer parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.yelp.nrtsearch.server.grpc.Rescorer 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.Rescorer parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.yelp.nrtsearch.server.grpc.Rescorer 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.Rescorer parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static com.yelp.nrtsearch.server.grpc.Rescorer 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.Rescorer 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.Rescorer 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.Rescorer 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;
}
/**
*
* Defines a rescorer which is executed after the first search pass
*
*
* Protobuf type {@code luceneserver.Rescorer}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:luceneserver.Rescorer)
com.yelp.nrtsearch.server.grpc.RescorerOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.yelp.nrtsearch.server.grpc.SearchResponseProto.internal_static_luceneserver_Rescorer_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.yelp.nrtsearch.server.grpc.SearchResponseProto.internal_static_luceneserver_Rescorer_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.yelp.nrtsearch.server.grpc.Rescorer.class, com.yelp.nrtsearch.server.grpc.Rescorer.Builder.class);
}
// Construct using com.yelp.nrtsearch.server.grpc.Rescorer.newBuilder()
private Builder() {
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
windowSize_ = 0;
if (queryRescorerBuilder_ != null) {
queryRescorerBuilder_.clear();
}
if (pluginRescorerBuilder_ != null) {
pluginRescorerBuilder_.clear();
}
name_ = "";
rescorersCase_ = 0;
rescorers_ = null;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.yelp.nrtsearch.server.grpc.SearchResponseProto.internal_static_luceneserver_Rescorer_descriptor;
}
@java.lang.Override
public com.yelp.nrtsearch.server.grpc.Rescorer getDefaultInstanceForType() {
return com.yelp.nrtsearch.server.grpc.Rescorer.getDefaultInstance();
}
@java.lang.Override
public com.yelp.nrtsearch.server.grpc.Rescorer build() {
com.yelp.nrtsearch.server.grpc.Rescorer result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.yelp.nrtsearch.server.grpc.Rescorer buildPartial() {
com.yelp.nrtsearch.server.grpc.Rescorer result = new com.yelp.nrtsearch.server.grpc.Rescorer(this);
if (bitField0_ != 0) { buildPartial0(result); }
buildPartialOneofs(result);
onBuilt();
return result;
}
private void buildPartial0(com.yelp.nrtsearch.server.grpc.Rescorer result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.windowSize_ = windowSize_;
}
if (((from_bitField0_ & 0x00000008) != 0)) {
result.name_ = name_;
}
}
private void buildPartialOneofs(com.yelp.nrtsearch.server.grpc.Rescorer result) {
result.rescorersCase_ = rescorersCase_;
result.rescorers_ = this.rescorers_;
if (rescorersCase_ == 2 &&
queryRescorerBuilder_ != null) {
result.rescorers_ = queryRescorerBuilder_.build();
}
if (rescorersCase_ == 3 &&
pluginRescorerBuilder_ != null) {
result.rescorers_ = pluginRescorerBuilder_.build();
}
}
@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.Rescorer) {
return mergeFrom((com.yelp.nrtsearch.server.grpc.Rescorer)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.yelp.nrtsearch.server.grpc.Rescorer other) {
if (other == com.yelp.nrtsearch.server.grpc.Rescorer.getDefaultInstance()) return this;
if (other.getWindowSize() != 0) {
setWindowSize(other.getWindowSize());
}
if (!other.getName().isEmpty()) {
name_ = other.name_;
bitField0_ |= 0x00000008;
onChanged();
}
switch (other.getRescorersCase()) {
case QUERYRESCORER: {
mergeQueryRescorer(other.getQueryRescorer());
break;
}
case PLUGINRESCORER: {
mergePluginRescorer(other.getPluginRescorer());
break;
}
case RESCORERS_NOT_SET: {
break;
}
}
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 8: {
windowSize_ = input.readInt32();
bitField0_ |= 0x00000001;
break;
} // case 8
case 18: {
input.readMessage(
getQueryRescorerFieldBuilder().getBuilder(),
extensionRegistry);
rescorersCase_ = 2;
break;
} // case 18
case 26: {
input.readMessage(
getPluginRescorerFieldBuilder().getBuilder(),
extensionRegistry);
rescorersCase_ = 3;
break;
} // case 26
case 34: {
name_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000008;
break;
} // case 34
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 rescorersCase_ = 0;
private java.lang.Object rescorers_;
public RescorersCase
getRescorersCase() {
return RescorersCase.forNumber(
rescorersCase_);
}
public Builder clearRescorers() {
rescorersCase_ = 0;
rescorers_ = null;
onChanged();
return this;
}
private int bitField0_;
private int windowSize_ ;
/**
* int32 windowSize = 1;
* @return The windowSize.
*/
@java.lang.Override
public int getWindowSize() {
return windowSize_;
}
/**
* int32 windowSize = 1;
* @param value The windowSize to set.
* @return This builder for chaining.
*/
public Builder setWindowSize(int value) {
windowSize_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
* int32 windowSize = 1;
* @return This builder for chaining.
*/
public Builder clearWindowSize() {
bitField0_ = (bitField0_ & ~0x00000001);
windowSize_ = 0;
onChanged();
return this;
}
private com.google.protobuf.SingleFieldBuilderV3<
com.yelp.nrtsearch.server.grpc.QueryRescorer, com.yelp.nrtsearch.server.grpc.QueryRescorer.Builder, com.yelp.nrtsearch.server.grpc.QueryRescorerOrBuilder> queryRescorerBuilder_;
/**
* .luceneserver.QueryRescorer queryRescorer = 2;
* @return Whether the queryRescorer field is set.
*/
@java.lang.Override
public boolean hasQueryRescorer() {
return rescorersCase_ == 2;
}
/**
* .luceneserver.QueryRescorer queryRescorer = 2;
* @return The queryRescorer.
*/
@java.lang.Override
public com.yelp.nrtsearch.server.grpc.QueryRescorer getQueryRescorer() {
if (queryRescorerBuilder_ == null) {
if (rescorersCase_ == 2) {
return (com.yelp.nrtsearch.server.grpc.QueryRescorer) rescorers_;
}
return com.yelp.nrtsearch.server.grpc.QueryRescorer.getDefaultInstance();
} else {
if (rescorersCase_ == 2) {
return queryRescorerBuilder_.getMessage();
}
return com.yelp.nrtsearch.server.grpc.QueryRescorer.getDefaultInstance();
}
}
/**
* .luceneserver.QueryRescorer queryRescorer = 2;
*/
public Builder setQueryRescorer(com.yelp.nrtsearch.server.grpc.QueryRescorer value) {
if (queryRescorerBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
rescorers_ = value;
onChanged();
} else {
queryRescorerBuilder_.setMessage(value);
}
rescorersCase_ = 2;
return this;
}
/**
* .luceneserver.QueryRescorer queryRescorer = 2;
*/
public Builder setQueryRescorer(
com.yelp.nrtsearch.server.grpc.QueryRescorer.Builder builderForValue) {
if (queryRescorerBuilder_ == null) {
rescorers_ = builderForValue.build();
onChanged();
} else {
queryRescorerBuilder_.setMessage(builderForValue.build());
}
rescorersCase_ = 2;
return this;
}
/**
* .luceneserver.QueryRescorer queryRescorer = 2;
*/
public Builder mergeQueryRescorer(com.yelp.nrtsearch.server.grpc.QueryRescorer value) {
if (queryRescorerBuilder_ == null) {
if (rescorersCase_ == 2 &&
rescorers_ != com.yelp.nrtsearch.server.grpc.QueryRescorer.getDefaultInstance()) {
rescorers_ = com.yelp.nrtsearch.server.grpc.QueryRescorer.newBuilder((com.yelp.nrtsearch.server.grpc.QueryRescorer) rescorers_)
.mergeFrom(value).buildPartial();
} else {
rescorers_ = value;
}
onChanged();
} else {
if (rescorersCase_ == 2) {
queryRescorerBuilder_.mergeFrom(value);
} else {
queryRescorerBuilder_.setMessage(value);
}
}
rescorersCase_ = 2;
return this;
}
/**
* .luceneserver.QueryRescorer queryRescorer = 2;
*/
public Builder clearQueryRescorer() {
if (queryRescorerBuilder_ == null) {
if (rescorersCase_ == 2) {
rescorersCase_ = 0;
rescorers_ = null;
onChanged();
}
} else {
if (rescorersCase_ == 2) {
rescorersCase_ = 0;
rescorers_ = null;
}
queryRescorerBuilder_.clear();
}
return this;
}
/**
* .luceneserver.QueryRescorer queryRescorer = 2;
*/
public com.yelp.nrtsearch.server.grpc.QueryRescorer.Builder getQueryRescorerBuilder() {
return getQueryRescorerFieldBuilder().getBuilder();
}
/**
* .luceneserver.QueryRescorer queryRescorer = 2;
*/
@java.lang.Override
public com.yelp.nrtsearch.server.grpc.QueryRescorerOrBuilder getQueryRescorerOrBuilder() {
if ((rescorersCase_ == 2) && (queryRescorerBuilder_ != null)) {
return queryRescorerBuilder_.getMessageOrBuilder();
} else {
if (rescorersCase_ == 2) {
return (com.yelp.nrtsearch.server.grpc.QueryRescorer) rescorers_;
}
return com.yelp.nrtsearch.server.grpc.QueryRescorer.getDefaultInstance();
}
}
/**
* .luceneserver.QueryRescorer queryRescorer = 2;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.yelp.nrtsearch.server.grpc.QueryRescorer, com.yelp.nrtsearch.server.grpc.QueryRescorer.Builder, com.yelp.nrtsearch.server.grpc.QueryRescorerOrBuilder>
getQueryRescorerFieldBuilder() {
if (queryRescorerBuilder_ == null) {
if (!(rescorersCase_ == 2)) {
rescorers_ = com.yelp.nrtsearch.server.grpc.QueryRescorer.getDefaultInstance();
}
queryRescorerBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
com.yelp.nrtsearch.server.grpc.QueryRescorer, com.yelp.nrtsearch.server.grpc.QueryRescorer.Builder, com.yelp.nrtsearch.server.grpc.QueryRescorerOrBuilder>(
(com.yelp.nrtsearch.server.grpc.QueryRescorer) rescorers_,
getParentForChildren(),
isClean());
rescorers_ = null;
}
rescorersCase_ = 2;
onChanged();
return queryRescorerBuilder_;
}
private com.google.protobuf.SingleFieldBuilderV3<
com.yelp.nrtsearch.server.grpc.PluginRescorer, com.yelp.nrtsearch.server.grpc.PluginRescorer.Builder, com.yelp.nrtsearch.server.grpc.PluginRescorerOrBuilder> pluginRescorerBuilder_;
/**
* .luceneserver.PluginRescorer pluginRescorer = 3;
* @return Whether the pluginRescorer field is set.
*/
@java.lang.Override
public boolean hasPluginRescorer() {
return rescorersCase_ == 3;
}
/**
* .luceneserver.PluginRescorer pluginRescorer = 3;
* @return The pluginRescorer.
*/
@java.lang.Override
public com.yelp.nrtsearch.server.grpc.PluginRescorer getPluginRescorer() {
if (pluginRescorerBuilder_ == null) {
if (rescorersCase_ == 3) {
return (com.yelp.nrtsearch.server.grpc.PluginRescorer) rescorers_;
}
return com.yelp.nrtsearch.server.grpc.PluginRescorer.getDefaultInstance();
} else {
if (rescorersCase_ == 3) {
return pluginRescorerBuilder_.getMessage();
}
return com.yelp.nrtsearch.server.grpc.PluginRescorer.getDefaultInstance();
}
}
/**
* .luceneserver.PluginRescorer pluginRescorer = 3;
*/
public Builder setPluginRescorer(com.yelp.nrtsearch.server.grpc.PluginRescorer value) {
if (pluginRescorerBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
rescorers_ = value;
onChanged();
} else {
pluginRescorerBuilder_.setMessage(value);
}
rescorersCase_ = 3;
return this;
}
/**
* .luceneserver.PluginRescorer pluginRescorer = 3;
*/
public Builder setPluginRescorer(
com.yelp.nrtsearch.server.grpc.PluginRescorer.Builder builderForValue) {
if (pluginRescorerBuilder_ == null) {
rescorers_ = builderForValue.build();
onChanged();
} else {
pluginRescorerBuilder_.setMessage(builderForValue.build());
}
rescorersCase_ = 3;
return this;
}
/**
* .luceneserver.PluginRescorer pluginRescorer = 3;
*/
public Builder mergePluginRescorer(com.yelp.nrtsearch.server.grpc.PluginRescorer value) {
if (pluginRescorerBuilder_ == null) {
if (rescorersCase_ == 3 &&
rescorers_ != com.yelp.nrtsearch.server.grpc.PluginRescorer.getDefaultInstance()) {
rescorers_ = com.yelp.nrtsearch.server.grpc.PluginRescorer.newBuilder((com.yelp.nrtsearch.server.grpc.PluginRescorer) rescorers_)
.mergeFrom(value).buildPartial();
} else {
rescorers_ = value;
}
onChanged();
} else {
if (rescorersCase_ == 3) {
pluginRescorerBuilder_.mergeFrom(value);
} else {
pluginRescorerBuilder_.setMessage(value);
}
}
rescorersCase_ = 3;
return this;
}
/**
* .luceneserver.PluginRescorer pluginRescorer = 3;
*/
public Builder clearPluginRescorer() {
if (pluginRescorerBuilder_ == null) {
if (rescorersCase_ == 3) {
rescorersCase_ = 0;
rescorers_ = null;
onChanged();
}
} else {
if (rescorersCase_ == 3) {
rescorersCase_ = 0;
rescorers_ = null;
}
pluginRescorerBuilder_.clear();
}
return this;
}
/**
* .luceneserver.PluginRescorer pluginRescorer = 3;
*/
public com.yelp.nrtsearch.server.grpc.PluginRescorer.Builder getPluginRescorerBuilder() {
return getPluginRescorerFieldBuilder().getBuilder();
}
/**
* .luceneserver.PluginRescorer pluginRescorer = 3;
*/
@java.lang.Override
public com.yelp.nrtsearch.server.grpc.PluginRescorerOrBuilder getPluginRescorerOrBuilder() {
if ((rescorersCase_ == 3) && (pluginRescorerBuilder_ != null)) {
return pluginRescorerBuilder_.getMessageOrBuilder();
} else {
if (rescorersCase_ == 3) {
return (com.yelp.nrtsearch.server.grpc.PluginRescorer) rescorers_;
}
return com.yelp.nrtsearch.server.grpc.PluginRescorer.getDefaultInstance();
}
}
/**
* .luceneserver.PluginRescorer pluginRescorer = 3;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.yelp.nrtsearch.server.grpc.PluginRescorer, com.yelp.nrtsearch.server.grpc.PluginRescorer.Builder, com.yelp.nrtsearch.server.grpc.PluginRescorerOrBuilder>
getPluginRescorerFieldBuilder() {
if (pluginRescorerBuilder_ == null) {
if (!(rescorersCase_ == 3)) {
rescorers_ = com.yelp.nrtsearch.server.grpc.PluginRescorer.getDefaultInstance();
}
pluginRescorerBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
com.yelp.nrtsearch.server.grpc.PluginRescorer, com.yelp.nrtsearch.server.grpc.PluginRescorer.Builder, com.yelp.nrtsearch.server.grpc.PluginRescorerOrBuilder>(
(com.yelp.nrtsearch.server.grpc.PluginRescorer) rescorers_,
getParentForChildren(),
isClean());
rescorers_ = null;
}
rescorersCase_ = 3;
onChanged();
return pluginRescorerBuilder_;
}
private java.lang.Object name_ = "";
/**
*
* Must be unique for each Rescorer
*
*
* string name = 4;
* @return The name.
*/
public java.lang.String getName() {
java.lang.Object ref = name_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
name_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* Must be unique for each Rescorer
*
*
* string name = 4;
* @return The bytes for name.
*/
public com.google.protobuf.ByteString
getNameBytes() {
java.lang.Object ref = name_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
name_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* Must be unique for each Rescorer
*
*
* string name = 4;
* @param value The name to set.
* @return This builder for chaining.
*/
public Builder setName(
java.lang.String value) {
if (value == null) { throw new NullPointerException(); }
name_ = value;
bitField0_ |= 0x00000008;
onChanged();
return this;
}
/**
*
* Must be unique for each Rescorer
*
*
* string name = 4;
* @return This builder for chaining.
*/
public Builder clearName() {
name_ = getDefaultInstance().getName();
bitField0_ = (bitField0_ & ~0x00000008);
onChanged();
return this;
}
/**
*
* Must be unique for each Rescorer
*
*
* string name = 4;
* @param value The bytes for name to set.
* @return This builder for chaining.
*/
public Builder setNameBytes(
com.google.protobuf.ByteString value) {
if (value == null) { throw new NullPointerException(); }
checkByteStringIsUtf8(value);
name_ = value;
bitField0_ |= 0x00000008;
onChanged();
return this;
}
@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.Rescorer)
}
// @@protoc_insertion_point(class_scope:luceneserver.Rescorer)
private static final com.yelp.nrtsearch.server.grpc.Rescorer DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.yelp.nrtsearch.server.grpc.Rescorer();
}
public static com.yelp.nrtsearch.server.grpc.Rescorer getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public Rescorer 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.Rescorer getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}