com.yelp.nrtsearch.server.grpc.TopHitsCollector 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;
/**
*
*Definition of top hits based collector.
*
*
* Protobuf type {@code luceneserver.TopHitsCollector}
*/
public final class TopHitsCollector extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:luceneserver.TopHitsCollector)
TopHitsCollectorOrBuilder {
private static final long serialVersionUID = 0L;
// Use TopHitsCollector.newBuilder() to construct.
private TopHitsCollector(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private TopHitsCollector() {
retrieveFields_ =
com.google.protobuf.LazyStringArrayList.emptyList();
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new TopHitsCollector();
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.yelp.nrtsearch.server.grpc.SearchResponseProto.internal_static_luceneserver_TopHitsCollector_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.yelp.nrtsearch.server.grpc.SearchResponseProto.internal_static_luceneserver_TopHitsCollector_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.yelp.nrtsearch.server.grpc.TopHitsCollector.class, com.yelp.nrtsearch.server.grpc.TopHitsCollector.Builder.class);
}
private int bitField0_;
public static final int STARTHIT_FIELD_NUMBER = 1;
private int startHit_ = 0;
/**
*
*Offset for retrieval of top hits.
*
*
* int32 startHit = 1;
* @return The startHit.
*/
@java.lang.Override
public int getStartHit() {
return startHit_;
}
public static final int TOPHITS_FIELD_NUMBER = 2;
private int topHits_ = 0;
/**
*
*Total hits to collect, note that the number of hits returned is (topHits - startHit).
*
*
* int32 topHits = 2;
* @return The topHits.
*/
@java.lang.Override
public int getTopHits() {
return topHits_;
}
public static final int QUERYSORT_FIELD_NUMBER = 3;
private com.yelp.nrtsearch.server.grpc.QuerySortField querySort_;
/**
*
*When specified, collector does sort based collection. Otherwise, relevance score is used.
*
*
* .luceneserver.QuerySortField querySort = 3;
* @return Whether the querySort field is set.
*/
@java.lang.Override
public boolean hasQuerySort() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
*
*When specified, collector does sort based collection. Otherwise, relevance score is used.
*
*
* .luceneserver.QuerySortField querySort = 3;
* @return The querySort.
*/
@java.lang.Override
public com.yelp.nrtsearch.server.grpc.QuerySortField getQuerySort() {
return querySort_ == null ? com.yelp.nrtsearch.server.grpc.QuerySortField.getDefaultInstance() : querySort_;
}
/**
*
*When specified, collector does sort based collection. Otherwise, relevance score is used.
*
*
* .luceneserver.QuerySortField querySort = 3;
*/
@java.lang.Override
public com.yelp.nrtsearch.server.grpc.QuerySortFieldOrBuilder getQuerySortOrBuilder() {
return querySort_ == null ? com.yelp.nrtsearch.server.grpc.QuerySortField.getDefaultInstance() : querySort_;
}
public static final int RETRIEVEFIELDS_FIELD_NUMBER = 4;
@SuppressWarnings("serial")
private com.google.protobuf.LazyStringArrayList retrieveFields_ =
com.google.protobuf.LazyStringArrayList.emptyList();
/**
*
*Which fields to retrieve.
*
*
* repeated string retrieveFields = 4;
* @return A list containing the retrieveFields.
*/
public com.google.protobuf.ProtocolStringList
getRetrieveFieldsList() {
return retrieveFields_;
}
/**
*
*Which fields to retrieve.
*
*
* repeated string retrieveFields = 4;
* @return The count of retrieveFields.
*/
public int getRetrieveFieldsCount() {
return retrieveFields_.size();
}
/**
*
*Which fields to retrieve.
*
*
* repeated string retrieveFields = 4;
* @param index The index of the element to return.
* @return The retrieveFields at the given index.
*/
public java.lang.String getRetrieveFields(int index) {
return retrieveFields_.get(index);
}
/**
*
*Which fields to retrieve.
*
*
* repeated string retrieveFields = 4;
* @param index The index of the value to return.
* @return The bytes of the retrieveFields at the given index.
*/
public com.google.protobuf.ByteString
getRetrieveFieldsBytes(int index) {
return retrieveFields_.getByteString(index);
}
public static final int EXPLAIN_FIELD_NUMBER = 5;
private boolean explain_ = false;
/**
*
* If Lucene explanation should be included in the collector response
*
*
* bool explain = 5;
* @return The explain.
*/
@java.lang.Override
public boolean getExplain() {
return explain_;
}
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 (startHit_ != 0) {
output.writeInt32(1, startHit_);
}
if (topHits_ != 0) {
output.writeInt32(2, topHits_);
}
if (((bitField0_ & 0x00000001) != 0)) {
output.writeMessage(3, getQuerySort());
}
for (int i = 0; i < retrieveFields_.size(); i++) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 4, retrieveFields_.getRaw(i));
}
if (explain_ != false) {
output.writeBool(5, explain_);
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (startHit_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(1, startHit_);
}
if (topHits_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(2, topHits_);
}
if (((bitField0_ & 0x00000001) != 0)) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(3, getQuerySort());
}
{
int dataSize = 0;
for (int i = 0; i < retrieveFields_.size(); i++) {
dataSize += computeStringSizeNoTag(retrieveFields_.getRaw(i));
}
size += dataSize;
size += 1 * getRetrieveFieldsList().size();
}
if (explain_ != false) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(5, explain_);
}
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.TopHitsCollector)) {
return super.equals(obj);
}
com.yelp.nrtsearch.server.grpc.TopHitsCollector other = (com.yelp.nrtsearch.server.grpc.TopHitsCollector) obj;
if (getStartHit()
!= other.getStartHit()) return false;
if (getTopHits()
!= other.getTopHits()) return false;
if (hasQuerySort() != other.hasQuerySort()) return false;
if (hasQuerySort()) {
if (!getQuerySort()
.equals(other.getQuerySort())) return false;
}
if (!getRetrieveFieldsList()
.equals(other.getRetrieveFieldsList())) return false;
if (getExplain()
!= other.getExplain()) 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) + STARTHIT_FIELD_NUMBER;
hash = (53 * hash) + getStartHit();
hash = (37 * hash) + TOPHITS_FIELD_NUMBER;
hash = (53 * hash) + getTopHits();
if (hasQuerySort()) {
hash = (37 * hash) + QUERYSORT_FIELD_NUMBER;
hash = (53 * hash) + getQuerySort().hashCode();
}
if (getRetrieveFieldsCount() > 0) {
hash = (37 * hash) + RETRIEVEFIELDS_FIELD_NUMBER;
hash = (53 * hash) + getRetrieveFieldsList().hashCode();
}
hash = (37 * hash) + EXPLAIN_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
getExplain());
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.yelp.nrtsearch.server.grpc.TopHitsCollector parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.yelp.nrtsearch.server.grpc.TopHitsCollector 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.TopHitsCollector parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.yelp.nrtsearch.server.grpc.TopHitsCollector 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.TopHitsCollector parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.yelp.nrtsearch.server.grpc.TopHitsCollector 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.TopHitsCollector parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.yelp.nrtsearch.server.grpc.TopHitsCollector 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.TopHitsCollector parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static com.yelp.nrtsearch.server.grpc.TopHitsCollector 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.TopHitsCollector 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.TopHitsCollector 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.TopHitsCollector 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;
}
/**
*
*Definition of top hits based collector.
*
*
* Protobuf type {@code luceneserver.TopHitsCollector}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:luceneserver.TopHitsCollector)
com.yelp.nrtsearch.server.grpc.TopHitsCollectorOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.yelp.nrtsearch.server.grpc.SearchResponseProto.internal_static_luceneserver_TopHitsCollector_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.yelp.nrtsearch.server.grpc.SearchResponseProto.internal_static_luceneserver_TopHitsCollector_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.yelp.nrtsearch.server.grpc.TopHitsCollector.class, com.yelp.nrtsearch.server.grpc.TopHitsCollector.Builder.class);
}
// Construct using com.yelp.nrtsearch.server.grpc.TopHitsCollector.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
getQuerySortFieldBuilder();
}
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
startHit_ = 0;
topHits_ = 0;
querySort_ = null;
if (querySortBuilder_ != null) {
querySortBuilder_.dispose();
querySortBuilder_ = null;
}
retrieveFields_ =
com.google.protobuf.LazyStringArrayList.emptyList();
explain_ = false;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.yelp.nrtsearch.server.grpc.SearchResponseProto.internal_static_luceneserver_TopHitsCollector_descriptor;
}
@java.lang.Override
public com.yelp.nrtsearch.server.grpc.TopHitsCollector getDefaultInstanceForType() {
return com.yelp.nrtsearch.server.grpc.TopHitsCollector.getDefaultInstance();
}
@java.lang.Override
public com.yelp.nrtsearch.server.grpc.TopHitsCollector build() {
com.yelp.nrtsearch.server.grpc.TopHitsCollector result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.yelp.nrtsearch.server.grpc.TopHitsCollector buildPartial() {
com.yelp.nrtsearch.server.grpc.TopHitsCollector result = new com.yelp.nrtsearch.server.grpc.TopHitsCollector(this);
if (bitField0_ != 0) { buildPartial0(result); }
onBuilt();
return result;
}
private void buildPartial0(com.yelp.nrtsearch.server.grpc.TopHitsCollector result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.startHit_ = startHit_;
}
if (((from_bitField0_ & 0x00000002) != 0)) {
result.topHits_ = topHits_;
}
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000004) != 0)) {
result.querySort_ = querySortBuilder_ == null
? querySort_
: querySortBuilder_.build();
to_bitField0_ |= 0x00000001;
}
if (((from_bitField0_ & 0x00000008) != 0)) {
retrieveFields_.makeImmutable();
result.retrieveFields_ = retrieveFields_;
}
if (((from_bitField0_ & 0x00000010) != 0)) {
result.explain_ = explain_;
}
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.TopHitsCollector) {
return mergeFrom((com.yelp.nrtsearch.server.grpc.TopHitsCollector)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.yelp.nrtsearch.server.grpc.TopHitsCollector other) {
if (other == com.yelp.nrtsearch.server.grpc.TopHitsCollector.getDefaultInstance()) return this;
if (other.getStartHit() != 0) {
setStartHit(other.getStartHit());
}
if (other.getTopHits() != 0) {
setTopHits(other.getTopHits());
}
if (other.hasQuerySort()) {
mergeQuerySort(other.getQuerySort());
}
if (!other.retrieveFields_.isEmpty()) {
if (retrieveFields_.isEmpty()) {
retrieveFields_ = other.retrieveFields_;
bitField0_ |= 0x00000008;
} else {
ensureRetrieveFieldsIsMutable();
retrieveFields_.addAll(other.retrieveFields_);
}
onChanged();
}
if (other.getExplain() != false) {
setExplain(other.getExplain());
}
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: {
startHit_ = input.readInt32();
bitField0_ |= 0x00000001;
break;
} // case 8
case 16: {
topHits_ = input.readInt32();
bitField0_ |= 0x00000002;
break;
} // case 16
case 26: {
input.readMessage(
getQuerySortFieldBuilder().getBuilder(),
extensionRegistry);
bitField0_ |= 0x00000004;
break;
} // case 26
case 34: {
java.lang.String s = input.readStringRequireUtf8();
ensureRetrieveFieldsIsMutable();
retrieveFields_.add(s);
break;
} // case 34
case 40: {
explain_ = input.readBool();
bitField0_ |= 0x00000010;
break;
} // case 40
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 int startHit_ ;
/**
*
*Offset for retrieval of top hits.
*
*
* int32 startHit = 1;
* @return The startHit.
*/
@java.lang.Override
public int getStartHit() {
return startHit_;
}
/**
*
*Offset for retrieval of top hits.
*
*
* int32 startHit = 1;
* @param value The startHit to set.
* @return This builder for chaining.
*/
public Builder setStartHit(int value) {
startHit_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
*
*Offset for retrieval of top hits.
*
*
* int32 startHit = 1;
* @return This builder for chaining.
*/
public Builder clearStartHit() {
bitField0_ = (bitField0_ & ~0x00000001);
startHit_ = 0;
onChanged();
return this;
}
private int topHits_ ;
/**
*
*Total hits to collect, note that the number of hits returned is (topHits - startHit).
*
*
* int32 topHits = 2;
* @return The topHits.
*/
@java.lang.Override
public int getTopHits() {
return topHits_;
}
/**
*
*Total hits to collect, note that the number of hits returned is (topHits - startHit).
*
*
* int32 topHits = 2;
* @param value The topHits to set.
* @return This builder for chaining.
*/
public Builder setTopHits(int value) {
topHits_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
*
*Total hits to collect, note that the number of hits returned is (topHits - startHit).
*
*
* int32 topHits = 2;
* @return This builder for chaining.
*/
public Builder clearTopHits() {
bitField0_ = (bitField0_ & ~0x00000002);
topHits_ = 0;
onChanged();
return this;
}
private com.yelp.nrtsearch.server.grpc.QuerySortField querySort_;
private com.google.protobuf.SingleFieldBuilderV3<
com.yelp.nrtsearch.server.grpc.QuerySortField, com.yelp.nrtsearch.server.grpc.QuerySortField.Builder, com.yelp.nrtsearch.server.grpc.QuerySortFieldOrBuilder> querySortBuilder_;
/**
*
*When specified, collector does sort based collection. Otherwise, relevance score is used.
*
*
* .luceneserver.QuerySortField querySort = 3;
* @return Whether the querySort field is set.
*/
public boolean hasQuerySort() {
return ((bitField0_ & 0x00000004) != 0);
}
/**
*
*When specified, collector does sort based collection. Otherwise, relevance score is used.
*
*
* .luceneserver.QuerySortField querySort = 3;
* @return The querySort.
*/
public com.yelp.nrtsearch.server.grpc.QuerySortField getQuerySort() {
if (querySortBuilder_ == null) {
return querySort_ == null ? com.yelp.nrtsearch.server.grpc.QuerySortField.getDefaultInstance() : querySort_;
} else {
return querySortBuilder_.getMessage();
}
}
/**
*
*When specified, collector does sort based collection. Otherwise, relevance score is used.
*
*
* .luceneserver.QuerySortField querySort = 3;
*/
public Builder setQuerySort(com.yelp.nrtsearch.server.grpc.QuerySortField value) {
if (querySortBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
querySort_ = value;
} else {
querySortBuilder_.setMessage(value);
}
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
*
*When specified, collector does sort based collection. Otherwise, relevance score is used.
*
*
* .luceneserver.QuerySortField querySort = 3;
*/
public Builder setQuerySort(
com.yelp.nrtsearch.server.grpc.QuerySortField.Builder builderForValue) {
if (querySortBuilder_ == null) {
querySort_ = builderForValue.build();
} else {
querySortBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
*
*When specified, collector does sort based collection. Otherwise, relevance score is used.
*
*
* .luceneserver.QuerySortField querySort = 3;
*/
public Builder mergeQuerySort(com.yelp.nrtsearch.server.grpc.QuerySortField value) {
if (querySortBuilder_ == null) {
if (((bitField0_ & 0x00000004) != 0) &&
querySort_ != null &&
querySort_ != com.yelp.nrtsearch.server.grpc.QuerySortField.getDefaultInstance()) {
getQuerySortBuilder().mergeFrom(value);
} else {
querySort_ = value;
}
} else {
querySortBuilder_.mergeFrom(value);
}
if (querySort_ != null) {
bitField0_ |= 0x00000004;
onChanged();
}
return this;
}
/**
*
*When specified, collector does sort based collection. Otherwise, relevance score is used.
*
*
* .luceneserver.QuerySortField querySort = 3;
*/
public Builder clearQuerySort() {
bitField0_ = (bitField0_ & ~0x00000004);
querySort_ = null;
if (querySortBuilder_ != null) {
querySortBuilder_.dispose();
querySortBuilder_ = null;
}
onChanged();
return this;
}
/**
*
*When specified, collector does sort based collection. Otherwise, relevance score is used.
*
*
* .luceneserver.QuerySortField querySort = 3;
*/
public com.yelp.nrtsearch.server.grpc.QuerySortField.Builder getQuerySortBuilder() {
bitField0_ |= 0x00000004;
onChanged();
return getQuerySortFieldBuilder().getBuilder();
}
/**
*
*When specified, collector does sort based collection. Otherwise, relevance score is used.
*
*
* .luceneserver.QuerySortField querySort = 3;
*/
public com.yelp.nrtsearch.server.grpc.QuerySortFieldOrBuilder getQuerySortOrBuilder() {
if (querySortBuilder_ != null) {
return querySortBuilder_.getMessageOrBuilder();
} else {
return querySort_ == null ?
com.yelp.nrtsearch.server.grpc.QuerySortField.getDefaultInstance() : querySort_;
}
}
/**
*
*When specified, collector does sort based collection. Otherwise, relevance score is used.
*
*
* .luceneserver.QuerySortField querySort = 3;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.yelp.nrtsearch.server.grpc.QuerySortField, com.yelp.nrtsearch.server.grpc.QuerySortField.Builder, com.yelp.nrtsearch.server.grpc.QuerySortFieldOrBuilder>
getQuerySortFieldBuilder() {
if (querySortBuilder_ == null) {
querySortBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
com.yelp.nrtsearch.server.grpc.QuerySortField, com.yelp.nrtsearch.server.grpc.QuerySortField.Builder, com.yelp.nrtsearch.server.grpc.QuerySortFieldOrBuilder>(
getQuerySort(),
getParentForChildren(),
isClean());
querySort_ = null;
}
return querySortBuilder_;
}
private com.google.protobuf.LazyStringArrayList retrieveFields_ =
com.google.protobuf.LazyStringArrayList.emptyList();
private void ensureRetrieveFieldsIsMutable() {
if (!retrieveFields_.isModifiable()) {
retrieveFields_ = new com.google.protobuf.LazyStringArrayList(retrieveFields_);
}
bitField0_ |= 0x00000008;
}
/**
*
*Which fields to retrieve.
*
*
* repeated string retrieveFields = 4;
* @return A list containing the retrieveFields.
*/
public com.google.protobuf.ProtocolStringList
getRetrieveFieldsList() {
retrieveFields_.makeImmutable();
return retrieveFields_;
}
/**
*
*Which fields to retrieve.
*
*
* repeated string retrieveFields = 4;
* @return The count of retrieveFields.
*/
public int getRetrieveFieldsCount() {
return retrieveFields_.size();
}
/**
*
*Which fields to retrieve.
*
*
* repeated string retrieveFields = 4;
* @param index The index of the element to return.
* @return The retrieveFields at the given index.
*/
public java.lang.String getRetrieveFields(int index) {
return retrieveFields_.get(index);
}
/**
*
*Which fields to retrieve.
*
*
* repeated string retrieveFields = 4;
* @param index The index of the value to return.
* @return The bytes of the retrieveFields at the given index.
*/
public com.google.protobuf.ByteString
getRetrieveFieldsBytes(int index) {
return retrieveFields_.getByteString(index);
}
/**
*
*Which fields to retrieve.
*
*
* repeated string retrieveFields = 4;
* @param index The index to set the value at.
* @param value The retrieveFields to set.
* @return This builder for chaining.
*/
public Builder setRetrieveFields(
int index, java.lang.String value) {
if (value == null) { throw new NullPointerException(); }
ensureRetrieveFieldsIsMutable();
retrieveFields_.set(index, value);
bitField0_ |= 0x00000008;
onChanged();
return this;
}
/**
*
*Which fields to retrieve.
*
*
* repeated string retrieveFields = 4;
* @param value The retrieveFields to add.
* @return This builder for chaining.
*/
public Builder addRetrieveFields(
java.lang.String value) {
if (value == null) { throw new NullPointerException(); }
ensureRetrieveFieldsIsMutable();
retrieveFields_.add(value);
bitField0_ |= 0x00000008;
onChanged();
return this;
}
/**
*
*Which fields to retrieve.
*
*
* repeated string retrieveFields = 4;
* @param values The retrieveFields to add.
* @return This builder for chaining.
*/
public Builder addAllRetrieveFields(
java.lang.Iterable values) {
ensureRetrieveFieldsIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, retrieveFields_);
bitField0_ |= 0x00000008;
onChanged();
return this;
}
/**
*
*Which fields to retrieve.
*
*
* repeated string retrieveFields = 4;
* @return This builder for chaining.
*/
public Builder clearRetrieveFields() {
retrieveFields_ =
com.google.protobuf.LazyStringArrayList.emptyList();
bitField0_ = (bitField0_ & ~0x00000008);;
onChanged();
return this;
}
/**
*
*Which fields to retrieve.
*
*
* repeated string retrieveFields = 4;
* @param value The bytes of the retrieveFields to add.
* @return This builder for chaining.
*/
public Builder addRetrieveFieldsBytes(
com.google.protobuf.ByteString value) {
if (value == null) { throw new NullPointerException(); }
checkByteStringIsUtf8(value);
ensureRetrieveFieldsIsMutable();
retrieveFields_.add(value);
bitField0_ |= 0x00000008;
onChanged();
return this;
}
private boolean explain_ ;
/**
*
* If Lucene explanation should be included in the collector response
*
*
* bool explain = 5;
* @return The explain.
*/
@java.lang.Override
public boolean getExplain() {
return explain_;
}
/**
*
* If Lucene explanation should be included in the collector response
*
*
* bool explain = 5;
* @param value The explain to set.
* @return This builder for chaining.
*/
public Builder setExplain(boolean value) {
explain_ = value;
bitField0_ |= 0x00000010;
onChanged();
return this;
}
/**
*
* If Lucene explanation should be included in the collector response
*
*
* bool explain = 5;
* @return This builder for chaining.
*/
public Builder clearExplain() {
bitField0_ = (bitField0_ & ~0x00000010);
explain_ = false;
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.TopHitsCollector)
}
// @@protoc_insertion_point(class_scope:luceneserver.TopHitsCollector)
private static final com.yelp.nrtsearch.server.grpc.TopHitsCollector DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.yelp.nrtsearch.server.grpc.TopHitsCollector();
}
public static com.yelp.nrtsearch.server.grpc.TopHitsCollector getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public TopHitsCollector 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.TopHitsCollector getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}