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

com.yelp.nrtsearch.server.grpc.OneSuggestLookupResponse Maven / Gradle / Ivy

There is a newer version: 1.0.0-beta.1
Show newest version
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: yelp/nrtsearch/suggest.proto

// Protobuf Java Version: 3.25.3
package com.yelp.nrtsearch.server.grpc;

/**
 * Protobuf type {@code luceneserver.OneSuggestLookupResponse}
 */
public final class OneSuggestLookupResponse extends
    com.google.protobuf.GeneratedMessageV3 implements
    // @@protoc_insertion_point(message_implements:luceneserver.OneSuggestLookupResponse)
    OneSuggestLookupResponseOrBuilder {
private static final long serialVersionUID = 0L;
  // Use OneSuggestLookupResponse.newBuilder() to construct.
  private OneSuggestLookupResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) {
    super(builder);
  }
  private OneSuggestLookupResponse() {
    payload_ = "";
  }

  @java.lang.Override
  @SuppressWarnings({"unused"})
  protected java.lang.Object newInstance(
      UnusedPrivateParameter unused) {
    return new OneSuggestLookupResponse();
  }

  public static final com.google.protobuf.Descriptors.Descriptor
      getDescriptor() {
    return com.yelp.nrtsearch.server.grpc.SuggestResponseProto.internal_static_luceneserver_OneSuggestLookupResponse_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.yelp.nrtsearch.server.grpc.SuggestResponseProto.internal_static_luceneserver_OneSuggestLookupResponse_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.yelp.nrtsearch.server.grpc.OneSuggestLookupResponse.class, com.yelp.nrtsearch.server.grpc.OneSuggestLookupResponse.Builder.class);
  }

  private int highlightKeyCase_ = 0;
  @SuppressWarnings("serial")
  private java.lang.Object highlightKey_;
  public enum HighlightKeyCase
      implements com.google.protobuf.Internal.EnumLite,
          com.google.protobuf.AbstractMessage.InternalOneOfEnum {
    SUGGESTLOOKUPHIGHLIGHT(1),
    KEY(2),
    HIGHLIGHTKEY_NOT_SET(0);
    private final int value;
    private HighlightKeyCase(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 HighlightKeyCase valueOf(int value) {
      return forNumber(value);
    }

    public static HighlightKeyCase forNumber(int value) {
      switch (value) {
        case 1: return SUGGESTLOOKUPHIGHLIGHT;
        case 2: return KEY;
        case 0: return HIGHLIGHTKEY_NOT_SET;
        default: return null;
      }
    }
    public int getNumber() {
      return this.value;
    }
  };

  public HighlightKeyCase
  getHighlightKeyCase() {
    return HighlightKeyCase.forNumber(
        highlightKeyCase_);
  }

  public static final int SUGGESTLOOKUPHIGHLIGHT_FIELD_NUMBER = 1;
  /**
   * 
   * Expert: custom Object to hold the result of a highlighted suggestion (currently only works with AnalyzingInfixSuggester) 
   * 
* * .luceneserver.SuggestLookupHighlight suggestLookupHighlight = 1; * @return Whether the suggestLookupHighlight field is set. */ @java.lang.Override public boolean hasSuggestLookupHighlight() { return highlightKeyCase_ == 1; } /** *
   * Expert: custom Object to hold the result of a highlighted suggestion (currently only works with AnalyzingInfixSuggester) 
   * 
* * .luceneserver.SuggestLookupHighlight suggestLookupHighlight = 1; * @return The suggestLookupHighlight. */ @java.lang.Override public com.yelp.nrtsearch.server.grpc.SuggestLookupHighlight getSuggestLookupHighlight() { if (highlightKeyCase_ == 1) { return (com.yelp.nrtsearch.server.grpc.SuggestLookupHighlight) highlightKey_; } return com.yelp.nrtsearch.server.grpc.SuggestLookupHighlight.getDefaultInstance(); } /** *
   * Expert: custom Object to hold the result of a highlighted suggestion (currently only works with AnalyzingInfixSuggester) 
   * 
* * .luceneserver.SuggestLookupHighlight suggestLookupHighlight = 1; */ @java.lang.Override public com.yelp.nrtsearch.server.grpc.SuggestLookupHighlightOrBuilder getSuggestLookupHighlightOrBuilder() { if (highlightKeyCase_ == 1) { return (com.yelp.nrtsearch.server.grpc.SuggestLookupHighlight) highlightKey_; } return com.yelp.nrtsearch.server.grpc.SuggestLookupHighlight.getDefaultInstance(); } public static final int KEY_FIELD_NUMBER = 2; /** *
   * the key's text 
   * 
* * string key = 2; * @return Whether the key field is set. */ public boolean hasKey() { return highlightKeyCase_ == 2; } /** *
   * the key's text 
   * 
* * string key = 2; * @return The key. */ public java.lang.String getKey() { java.lang.Object ref = ""; if (highlightKeyCase_ == 2) { ref = highlightKey_; } 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(); if (highlightKeyCase_ == 2) { highlightKey_ = s; } return s; } } /** *
   * the key's text 
   * 
* * string key = 2; * @return The bytes for key. */ public com.google.protobuf.ByteString getKeyBytes() { java.lang.Object ref = ""; if (highlightKeyCase_ == 2) { ref = highlightKey_; } if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); if (highlightKeyCase_ == 2) { highlightKey_ = b; } return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int WEIGHT_FIELD_NUMBER = 3; private long weight_ = 0L; /** *
   *the key's weight
   * 
* * int64 weight = 3; * @return The weight. */ @java.lang.Override public long getWeight() { return weight_; } public static final int PAYLOAD_FIELD_NUMBER = 4; @SuppressWarnings("serial") private volatile java.lang.Object payload_ = ""; /** *
   *the key's payload (null if not present)
   * 
* * string payload = 4; * @return The payload. */ @java.lang.Override public java.lang.String getPayload() { java.lang.Object ref = payload_; 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(); payload_ = s; return s; } } /** *
   *the key's payload (null if not present)
   * 
* * string payload = 4; * @return The bytes for payload. */ @java.lang.Override public com.google.protobuf.ByteString getPayloadBytes() { java.lang.Object ref = payload_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); payload_ = 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 (highlightKeyCase_ == 1) { output.writeMessage(1, (com.yelp.nrtsearch.server.grpc.SuggestLookupHighlight) highlightKey_); } if (highlightKeyCase_ == 2) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, highlightKey_); } if (weight_ != 0L) { output.writeInt64(3, weight_); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(payload_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 4, payload_); } getUnknownFields().writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (highlightKeyCase_ == 1) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(1, (com.yelp.nrtsearch.server.grpc.SuggestLookupHighlight) highlightKey_); } if (highlightKeyCase_ == 2) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, highlightKey_); } if (weight_ != 0L) { size += com.google.protobuf.CodedOutputStream .computeInt64Size(3, weight_); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(payload_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, payload_); } 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.OneSuggestLookupResponse)) { return super.equals(obj); } com.yelp.nrtsearch.server.grpc.OneSuggestLookupResponse other = (com.yelp.nrtsearch.server.grpc.OneSuggestLookupResponse) obj; if (getWeight() != other.getWeight()) return false; if (!getPayload() .equals(other.getPayload())) return false; if (!getHighlightKeyCase().equals(other.getHighlightKeyCase())) return false; switch (highlightKeyCase_) { case 1: if (!getSuggestLookupHighlight() .equals(other.getSuggestLookupHighlight())) return false; break; case 2: if (!getKey() .equals(other.getKey())) 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) + WEIGHT_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( getWeight()); hash = (37 * hash) + PAYLOAD_FIELD_NUMBER; hash = (53 * hash) + getPayload().hashCode(); switch (highlightKeyCase_) { case 1: hash = (37 * hash) + SUGGESTLOOKUPHIGHLIGHT_FIELD_NUMBER; hash = (53 * hash) + getSuggestLookupHighlight().hashCode(); break; case 2: hash = (37 * hash) + KEY_FIELD_NUMBER; hash = (53 * hash) + getKey().hashCode(); break; case 0: default: } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } public static com.yelp.nrtsearch.server.grpc.OneSuggestLookupResponse parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.yelp.nrtsearch.server.grpc.OneSuggestLookupResponse 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.OneSuggestLookupResponse parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.yelp.nrtsearch.server.grpc.OneSuggestLookupResponse 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.OneSuggestLookupResponse parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.yelp.nrtsearch.server.grpc.OneSuggestLookupResponse 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.OneSuggestLookupResponse parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.yelp.nrtsearch.server.grpc.OneSuggestLookupResponse 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.OneSuggestLookupResponse parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static com.yelp.nrtsearch.server.grpc.OneSuggestLookupResponse 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.OneSuggestLookupResponse 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.OneSuggestLookupResponse 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.OneSuggestLookupResponse 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; } /** * Protobuf type {@code luceneserver.OneSuggestLookupResponse} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:luceneserver.OneSuggestLookupResponse) com.yelp.nrtsearch.server.grpc.OneSuggestLookupResponseOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.yelp.nrtsearch.server.grpc.SuggestResponseProto.internal_static_luceneserver_OneSuggestLookupResponse_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.yelp.nrtsearch.server.grpc.SuggestResponseProto.internal_static_luceneserver_OneSuggestLookupResponse_fieldAccessorTable .ensureFieldAccessorsInitialized( com.yelp.nrtsearch.server.grpc.OneSuggestLookupResponse.class, com.yelp.nrtsearch.server.grpc.OneSuggestLookupResponse.Builder.class); } // Construct using com.yelp.nrtsearch.server.grpc.OneSuggestLookupResponse.newBuilder() private Builder() { } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); bitField0_ = 0; if (suggestLookupHighlightBuilder_ != null) { suggestLookupHighlightBuilder_.clear(); } weight_ = 0L; payload_ = ""; highlightKeyCase_ = 0; highlightKey_ = null; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.yelp.nrtsearch.server.grpc.SuggestResponseProto.internal_static_luceneserver_OneSuggestLookupResponse_descriptor; } @java.lang.Override public com.yelp.nrtsearch.server.grpc.OneSuggestLookupResponse getDefaultInstanceForType() { return com.yelp.nrtsearch.server.grpc.OneSuggestLookupResponse.getDefaultInstance(); } @java.lang.Override public com.yelp.nrtsearch.server.grpc.OneSuggestLookupResponse build() { com.yelp.nrtsearch.server.grpc.OneSuggestLookupResponse result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public com.yelp.nrtsearch.server.grpc.OneSuggestLookupResponse buildPartial() { com.yelp.nrtsearch.server.grpc.OneSuggestLookupResponse result = new com.yelp.nrtsearch.server.grpc.OneSuggestLookupResponse(this); if (bitField0_ != 0) { buildPartial0(result); } buildPartialOneofs(result); onBuilt(); return result; } private void buildPartial0(com.yelp.nrtsearch.server.grpc.OneSuggestLookupResponse result) { int from_bitField0_ = bitField0_; if (((from_bitField0_ & 0x00000004) != 0)) { result.weight_ = weight_; } if (((from_bitField0_ & 0x00000008) != 0)) { result.payload_ = payload_; } } private void buildPartialOneofs(com.yelp.nrtsearch.server.grpc.OneSuggestLookupResponse result) { result.highlightKeyCase_ = highlightKeyCase_; result.highlightKey_ = this.highlightKey_; if (highlightKeyCase_ == 1 && suggestLookupHighlightBuilder_ != null) { result.highlightKey_ = suggestLookupHighlightBuilder_.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.OneSuggestLookupResponse) { return mergeFrom((com.yelp.nrtsearch.server.grpc.OneSuggestLookupResponse)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(com.yelp.nrtsearch.server.grpc.OneSuggestLookupResponse other) { if (other == com.yelp.nrtsearch.server.grpc.OneSuggestLookupResponse.getDefaultInstance()) return this; if (other.getWeight() != 0L) { setWeight(other.getWeight()); } if (!other.getPayload().isEmpty()) { payload_ = other.payload_; bitField0_ |= 0x00000008; onChanged(); } switch (other.getHighlightKeyCase()) { case SUGGESTLOOKUPHIGHLIGHT: { mergeSuggestLookupHighlight(other.getSuggestLookupHighlight()); break; } case KEY: { highlightKeyCase_ = 2; highlightKey_ = other.highlightKey_; onChanged(); break; } case HIGHLIGHTKEY_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 10: { input.readMessage( getSuggestLookupHighlightFieldBuilder().getBuilder(), extensionRegistry); highlightKeyCase_ = 1; break; } // case 10 case 18: { java.lang.String s = input.readStringRequireUtf8(); highlightKeyCase_ = 2; highlightKey_ = s; break; } // case 18 case 24: { weight_ = input.readInt64(); bitField0_ |= 0x00000004; break; } // case 24 case 34: { payload_ = 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 highlightKeyCase_ = 0; private java.lang.Object highlightKey_; public HighlightKeyCase getHighlightKeyCase() { return HighlightKeyCase.forNumber( highlightKeyCase_); } public Builder clearHighlightKey() { highlightKeyCase_ = 0; highlightKey_ = null; onChanged(); return this; } private int bitField0_; private com.google.protobuf.SingleFieldBuilderV3< com.yelp.nrtsearch.server.grpc.SuggestLookupHighlight, com.yelp.nrtsearch.server.grpc.SuggestLookupHighlight.Builder, com.yelp.nrtsearch.server.grpc.SuggestLookupHighlightOrBuilder> suggestLookupHighlightBuilder_; /** *
     * Expert: custom Object to hold the result of a highlighted suggestion (currently only works with AnalyzingInfixSuggester) 
     * 
* * .luceneserver.SuggestLookupHighlight suggestLookupHighlight = 1; * @return Whether the suggestLookupHighlight field is set. */ @java.lang.Override public boolean hasSuggestLookupHighlight() { return highlightKeyCase_ == 1; } /** *
     * Expert: custom Object to hold the result of a highlighted suggestion (currently only works with AnalyzingInfixSuggester) 
     * 
* * .luceneserver.SuggestLookupHighlight suggestLookupHighlight = 1; * @return The suggestLookupHighlight. */ @java.lang.Override public com.yelp.nrtsearch.server.grpc.SuggestLookupHighlight getSuggestLookupHighlight() { if (suggestLookupHighlightBuilder_ == null) { if (highlightKeyCase_ == 1) { return (com.yelp.nrtsearch.server.grpc.SuggestLookupHighlight) highlightKey_; } return com.yelp.nrtsearch.server.grpc.SuggestLookupHighlight.getDefaultInstance(); } else { if (highlightKeyCase_ == 1) { return suggestLookupHighlightBuilder_.getMessage(); } return com.yelp.nrtsearch.server.grpc.SuggestLookupHighlight.getDefaultInstance(); } } /** *
     * Expert: custom Object to hold the result of a highlighted suggestion (currently only works with AnalyzingInfixSuggester) 
     * 
* * .luceneserver.SuggestLookupHighlight suggestLookupHighlight = 1; */ public Builder setSuggestLookupHighlight(com.yelp.nrtsearch.server.grpc.SuggestLookupHighlight value) { if (suggestLookupHighlightBuilder_ == null) { if (value == null) { throw new NullPointerException(); } highlightKey_ = value; onChanged(); } else { suggestLookupHighlightBuilder_.setMessage(value); } highlightKeyCase_ = 1; return this; } /** *
     * Expert: custom Object to hold the result of a highlighted suggestion (currently only works with AnalyzingInfixSuggester) 
     * 
* * .luceneserver.SuggestLookupHighlight suggestLookupHighlight = 1; */ public Builder setSuggestLookupHighlight( com.yelp.nrtsearch.server.grpc.SuggestLookupHighlight.Builder builderForValue) { if (suggestLookupHighlightBuilder_ == null) { highlightKey_ = builderForValue.build(); onChanged(); } else { suggestLookupHighlightBuilder_.setMessage(builderForValue.build()); } highlightKeyCase_ = 1; return this; } /** *
     * Expert: custom Object to hold the result of a highlighted suggestion (currently only works with AnalyzingInfixSuggester) 
     * 
* * .luceneserver.SuggestLookupHighlight suggestLookupHighlight = 1; */ public Builder mergeSuggestLookupHighlight(com.yelp.nrtsearch.server.grpc.SuggestLookupHighlight value) { if (suggestLookupHighlightBuilder_ == null) { if (highlightKeyCase_ == 1 && highlightKey_ != com.yelp.nrtsearch.server.grpc.SuggestLookupHighlight.getDefaultInstance()) { highlightKey_ = com.yelp.nrtsearch.server.grpc.SuggestLookupHighlight.newBuilder((com.yelp.nrtsearch.server.grpc.SuggestLookupHighlight) highlightKey_) .mergeFrom(value).buildPartial(); } else { highlightKey_ = value; } onChanged(); } else { if (highlightKeyCase_ == 1) { suggestLookupHighlightBuilder_.mergeFrom(value); } else { suggestLookupHighlightBuilder_.setMessage(value); } } highlightKeyCase_ = 1; return this; } /** *
     * Expert: custom Object to hold the result of a highlighted suggestion (currently only works with AnalyzingInfixSuggester) 
     * 
* * .luceneserver.SuggestLookupHighlight suggestLookupHighlight = 1; */ public Builder clearSuggestLookupHighlight() { if (suggestLookupHighlightBuilder_ == null) { if (highlightKeyCase_ == 1) { highlightKeyCase_ = 0; highlightKey_ = null; onChanged(); } } else { if (highlightKeyCase_ == 1) { highlightKeyCase_ = 0; highlightKey_ = null; } suggestLookupHighlightBuilder_.clear(); } return this; } /** *
     * Expert: custom Object to hold the result of a highlighted suggestion (currently only works with AnalyzingInfixSuggester) 
     * 
* * .luceneserver.SuggestLookupHighlight suggestLookupHighlight = 1; */ public com.yelp.nrtsearch.server.grpc.SuggestLookupHighlight.Builder getSuggestLookupHighlightBuilder() { return getSuggestLookupHighlightFieldBuilder().getBuilder(); } /** *
     * Expert: custom Object to hold the result of a highlighted suggestion (currently only works with AnalyzingInfixSuggester) 
     * 
* * .luceneserver.SuggestLookupHighlight suggestLookupHighlight = 1; */ @java.lang.Override public com.yelp.nrtsearch.server.grpc.SuggestLookupHighlightOrBuilder getSuggestLookupHighlightOrBuilder() { if ((highlightKeyCase_ == 1) && (suggestLookupHighlightBuilder_ != null)) { return suggestLookupHighlightBuilder_.getMessageOrBuilder(); } else { if (highlightKeyCase_ == 1) { return (com.yelp.nrtsearch.server.grpc.SuggestLookupHighlight) highlightKey_; } return com.yelp.nrtsearch.server.grpc.SuggestLookupHighlight.getDefaultInstance(); } } /** *
     * Expert: custom Object to hold the result of a highlighted suggestion (currently only works with AnalyzingInfixSuggester) 
     * 
* * .luceneserver.SuggestLookupHighlight suggestLookupHighlight = 1; */ private com.google.protobuf.SingleFieldBuilderV3< com.yelp.nrtsearch.server.grpc.SuggestLookupHighlight, com.yelp.nrtsearch.server.grpc.SuggestLookupHighlight.Builder, com.yelp.nrtsearch.server.grpc.SuggestLookupHighlightOrBuilder> getSuggestLookupHighlightFieldBuilder() { if (suggestLookupHighlightBuilder_ == null) { if (!(highlightKeyCase_ == 1)) { highlightKey_ = com.yelp.nrtsearch.server.grpc.SuggestLookupHighlight.getDefaultInstance(); } suggestLookupHighlightBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.yelp.nrtsearch.server.grpc.SuggestLookupHighlight, com.yelp.nrtsearch.server.grpc.SuggestLookupHighlight.Builder, com.yelp.nrtsearch.server.grpc.SuggestLookupHighlightOrBuilder>( (com.yelp.nrtsearch.server.grpc.SuggestLookupHighlight) highlightKey_, getParentForChildren(), isClean()); highlightKey_ = null; } highlightKeyCase_ = 1; onChanged(); return suggestLookupHighlightBuilder_; } /** *
     * the key's text 
     * 
* * string key = 2; * @return Whether the key field is set. */ @java.lang.Override public boolean hasKey() { return highlightKeyCase_ == 2; } /** *
     * the key's text 
     * 
* * string key = 2; * @return The key. */ @java.lang.Override public java.lang.String getKey() { java.lang.Object ref = ""; if (highlightKeyCase_ == 2) { ref = highlightKey_; } if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (highlightKeyCase_ == 2) { highlightKey_ = s; } return s; } else { return (java.lang.String) ref; } } /** *
     * the key's text 
     * 
* * string key = 2; * @return The bytes for key. */ @java.lang.Override public com.google.protobuf.ByteString getKeyBytes() { java.lang.Object ref = ""; if (highlightKeyCase_ == 2) { ref = highlightKey_; } if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); if (highlightKeyCase_ == 2) { highlightKey_ = b; } return b; } else { return (com.google.protobuf.ByteString) ref; } } /** *
     * the key's text 
     * 
* * string key = 2; * @param value The key to set. * @return This builder for chaining. */ public Builder setKey( java.lang.String value) { if (value == null) { throw new NullPointerException(); } highlightKeyCase_ = 2; highlightKey_ = value; onChanged(); return this; } /** *
     * the key's text 
     * 
* * string key = 2; * @return This builder for chaining. */ public Builder clearKey() { if (highlightKeyCase_ == 2) { highlightKeyCase_ = 0; highlightKey_ = null; onChanged(); } return this; } /** *
     * the key's text 
     * 
* * string key = 2; * @param value The bytes for key to set. * @return This builder for chaining. */ public Builder setKeyBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); highlightKeyCase_ = 2; highlightKey_ = value; onChanged(); return this; } private long weight_ ; /** *
     *the key's weight
     * 
* * int64 weight = 3; * @return The weight. */ @java.lang.Override public long getWeight() { return weight_; } /** *
     *the key's weight
     * 
* * int64 weight = 3; * @param value The weight to set. * @return This builder for chaining. */ public Builder setWeight(long value) { weight_ = value; bitField0_ |= 0x00000004; onChanged(); return this; } /** *
     *the key's weight
     * 
* * int64 weight = 3; * @return This builder for chaining. */ public Builder clearWeight() { bitField0_ = (bitField0_ & ~0x00000004); weight_ = 0L; onChanged(); return this; } private java.lang.Object payload_ = ""; /** *
     *the key's payload (null if not present)
     * 
* * string payload = 4; * @return The payload. */ public java.lang.String getPayload() { java.lang.Object ref = payload_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); payload_ = s; return s; } else { return (java.lang.String) ref; } } /** *
     *the key's payload (null if not present)
     * 
* * string payload = 4; * @return The bytes for payload. */ public com.google.protobuf.ByteString getPayloadBytes() { java.lang.Object ref = payload_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); payload_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** *
     *the key's payload (null if not present)
     * 
* * string payload = 4; * @param value The payload to set. * @return This builder for chaining. */ public Builder setPayload( java.lang.String value) { if (value == null) { throw new NullPointerException(); } payload_ = value; bitField0_ |= 0x00000008; onChanged(); return this; } /** *
     *the key's payload (null if not present)
     * 
* * string payload = 4; * @return This builder for chaining. */ public Builder clearPayload() { payload_ = getDefaultInstance().getPayload(); bitField0_ = (bitField0_ & ~0x00000008); onChanged(); return this; } /** *
     *the key's payload (null if not present)
     * 
* * string payload = 4; * @param value The bytes for payload to set. * @return This builder for chaining. */ public Builder setPayloadBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); payload_ = 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.OneSuggestLookupResponse) } // @@protoc_insertion_point(class_scope:luceneserver.OneSuggestLookupResponse) private static final com.yelp.nrtsearch.server.grpc.OneSuggestLookupResponse DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.yelp.nrtsearch.server.grpc.OneSuggestLookupResponse(); } public static com.yelp.nrtsearch.server.grpc.OneSuggestLookupResponse getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override public OneSuggestLookupResponse 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.OneSuggestLookupResponse getDefaultInstanceForType() { return DEFAULT_INSTANCE; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy