// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: src/main/java/com/dream/flink/pb/proto/SearchResponse.proto

package com.dream.flink.pb;

/**
 * Protobuf type {@code com.dream.flink.pb.Result}
 */
public final class Result extends
    com.google.protobuf.GeneratedMessage implements
    // @@protoc_insertion_point(message_implements:com.dream.flink.pb.Result)
    ResultOrBuilder {
  // Use Result.newBuilder() to construct.
  private Result(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
    super(builder);
    this.unknownFields = builder.getUnknownFields();
  }
  private Result(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }

  private static final Result defaultInstance;
  public static Result getDefaultInstance() {
    return defaultInstance;
  }

  public Result getDefaultInstanceForType() {
    return defaultInstance;
  }

  private final com.google.protobuf.UnknownFieldSet unknownFields;
  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet
      getUnknownFields() {
    return this.unknownFields;
  }
  private Result(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    initFields();
    int mutable_bitField0_ = 0;
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          default: {
            if (!parseUnknownField(input, unknownFields,
                                   extensionRegistry, tag)) {
              done = true;
            }
            break;
          }
          case 10: {
            com.google.protobuf.ByteString bs = input.readBytes();
            bitField0_ |= 0x00000001;
            url_ = bs;
            break;
          }
          case 18: {
            com.google.protobuf.ByteString bs = input.readBytes();
            bitField0_ |= 0x00000002;
            title_ = bs;
            break;
          }
          case 26: {
            com.google.protobuf.ByteString bs = input.readBytes();
            if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) {
              snippets_ = new com.google.protobuf.LazyStringArrayList();
              mutable_bitField0_ |= 0x00000004;
            }
            snippets_.add(bs);
            break;
          }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(
          e.getMessage()).setUnfinishedMessage(this);
    } finally {
      if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) {
        snippets_ = snippets_.getUnmodifiableView();
      }
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }
  public static final com.google.protobuf.Descriptors.Descriptor
      getDescriptor() {
    return com.dream.flink.pb.SearchResponseProto.internal_static_com_dream_flink_pb_Result_descriptor;
  }

  protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.dream.flink.pb.SearchResponseProto.internal_static_com_dream_flink_pb_Result_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.dream.flink.pb.Result.class, com.dream.flink.pb.Result.Builder.class);
  }

  public static com.google.protobuf.Parser<Result> PARSER =
      new com.google.protobuf.AbstractParser<Result>() {
    public Result parsePartialFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return new Result(input, extensionRegistry);
    }
  };

  @java.lang.Override
  public com.google.protobuf.Parser<Result> getParserForType() {
    return PARSER;
  }

  private int bitField0_;
  public static final int URL_FIELD_NUMBER = 1;
  private java.lang.Object url_;
  /**
   * <code>required string url = 1;</code>
   */
  public boolean hasUrl() {
    return ((bitField0_ & 0x00000001) == 0x00000001);
  }
  /**
   * <code>required string url = 1;</code>
   */
  public java.lang.String getUrl() {
    java.lang.Object ref = url_;
    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 (bs.isValidUtf8()) {
        url_ = s;
      }
      return s;
    }
  }
  /**
   * <code>required string url = 1;</code>
   */
  public com.google.protobuf.ByteString
      getUrlBytes() {
    java.lang.Object ref = url_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      url_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int TITLE_FIELD_NUMBER = 2;
  private java.lang.Object title_;
  /**
   * <code>required string title = 2;</code>
   */
  public boolean hasTitle() {
    return ((bitField0_ & 0x00000002) == 0x00000002);
  }
  /**
   * <code>required string title = 2;</code>
   */
  public java.lang.String getTitle() {
    java.lang.Object ref = title_;
    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 (bs.isValidUtf8()) {
        title_ = s;
      }
      return s;
    }
  }
  /**
   * <code>required string title = 2;</code>
   */
  public com.google.protobuf.ByteString
      getTitleBytes() {
    java.lang.Object ref = title_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      title_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int SNIPPETS_FIELD_NUMBER = 3;
  private com.google.protobuf.LazyStringList snippets_;
  /**
   * <code>repeated string snippets = 3;</code>
   */
  public com.google.protobuf.ProtocolStringList
      getSnippetsList() {
    return snippets_;
  }
  /**
   * <code>repeated string snippets = 3;</code>
   */
  public int getSnippetsCount() {
    return snippets_.size();
  }
  /**
   * <code>repeated string snippets = 3;</code>
   */
  public java.lang.String getSnippets(int index) {
    return snippets_.get(index);
  }
  /**
   * <code>repeated string snippets = 3;</code>
   */
  public com.google.protobuf.ByteString
      getSnippetsBytes(int index) {
    return snippets_.getByteString(index);
  }

  private void initFields() {
    url_ = "";
    title_ = "";
    snippets_ = com.google.protobuf.LazyStringArrayList.EMPTY;
  }
  private byte memoizedIsInitialized = -1;
  public final boolean isInitialized() {
    byte isInitialized = memoizedIsInitialized;
    if (isInitialized == 1) return true;
    if (isInitialized == 0) return false;

    if (!hasUrl()) {
      memoizedIsInitialized = 0;
      return false;
    }
    if (!hasTitle()) {
      memoizedIsInitialized = 0;
      return false;
    }
    memoizedIsInitialized = 1;
    return true;
  }

  public void writeTo(com.google.protobuf.CodedOutputStream output)
                      throws java.io.IOException {
    getSerializedSize();
    if (((bitField0_ & 0x00000001) == 0x00000001)) {
      output.writeBytes(1, getUrlBytes());
    }
    if (((bitField0_ & 0x00000002) == 0x00000002)) {
      output.writeBytes(2, getTitleBytes());
    }
    for (int i = 0; i < snippets_.size(); i++) {
      output.writeBytes(3, snippets_.getByteString(i));
    }
    getUnknownFields().writeTo(output);
  }

  private int memoizedSerializedSize = -1;
  public int getSerializedSize() {
    int size = memoizedSerializedSize;
    if (size != -1) return size;

    size = 0;
    if (((bitField0_ & 0x00000001) == 0x00000001)) {
      size += com.google.protobuf.CodedOutputStream
        .computeBytesSize(1, getUrlBytes());
    }
    if (((bitField0_ & 0x00000002) == 0x00000002)) {
      size += com.google.protobuf.CodedOutputStream
        .computeBytesSize(2, getTitleBytes());
    }
    {
      int dataSize = 0;
      for (int i = 0; i < snippets_.size(); i++) {
        dataSize += com.google.protobuf.CodedOutputStream
          .computeBytesSizeNoTag(snippets_.getByteString(i));
      }
      size += dataSize;
      size += 1 * getSnippetsList().size();
    }
    size += getUnknownFields().getSerializedSize();
    memoizedSerializedSize = size;
    return size;
  }

  private static final long serialVersionUID = 0L;
  @java.lang.Override
  protected java.lang.Object writeReplace()
      throws java.io.ObjectStreamException {
    return super.writeReplace();
  }

  public static com.dream.flink.pb.Result parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.dream.flink.pb.Result parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.dream.flink.pb.Result parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.dream.flink.pb.Result parseFrom(
      byte[] data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.dream.flink.pb.Result parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return PARSER.parseFrom(input);
  }
  public static com.dream.flink.pb.Result parseFrom(
      java.io.InputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return PARSER.parseFrom(input, extensionRegistry);
  }
  public static com.dream.flink.pb.Result parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return PARSER.parseDelimitedFrom(input);
  }
  public static com.dream.flink.pb.Result parseDelimitedFrom(
      java.io.InputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return PARSER.parseDelimitedFrom(input, extensionRegistry);
  }
  public static com.dream.flink.pb.Result parseFrom(
      com.google.protobuf.CodedInputStream input)
      throws java.io.IOException {
    return PARSER.parseFrom(input);
  }
  public static com.dream.flink.pb.Result parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return PARSER.parseFrom(input, extensionRegistry);
  }

  public static Builder newBuilder() { return Builder.create(); }
  public Builder newBuilderForType() { return newBuilder(); }
  public static Builder newBuilder(com.dream.flink.pb.Result prototype) {
    return newBuilder().mergeFrom(prototype);
  }
  public Builder toBuilder() { return newBuilder(this); }

  @java.lang.Override
  protected Builder newBuilderForType(
      com.google.protobuf.GeneratedMessage.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }
  /**
   * Protobuf type {@code com.dream.flink.pb.Result}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessage.Builder<Builder> implements
      // @@protoc_insertion_point(builder_implements:com.dream.flink.pb.Result)
      com.dream.flink.pb.ResultOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return com.dream.flink.pb.SearchResponseProto.internal_static_com_dream_flink_pb_Result_descriptor;
    }

    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.dream.flink.pb.SearchResponseProto.internal_static_com_dream_flink_pb_Result_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.dream.flink.pb.Result.class, com.dream.flink.pb.Result.Builder.class);
    }

    // Construct using com.dream.flink.pb.Result.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

    private Builder(
        com.google.protobuf.GeneratedMessage.BuilderParent parent) {
      super(parent);
      maybeForceBuilderInitialization();
    }
    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
      }
    }
    private static Builder create() {
      return new Builder();
    }

    public Builder clear() {
      super.clear();
      url_ = "";
      bitField0_ = (bitField0_ & ~0x00000001);
      title_ = "";
      bitField0_ = (bitField0_ & ~0x00000002);
      snippets_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      bitField0_ = (bitField0_ & ~0x00000004);
      return this;
    }

    public Builder clone() {
      return create().mergeFrom(buildPartial());
    }

    public com.google.protobuf.Descriptors.Descriptor
        getDescriptorForType() {
      return com.dream.flink.pb.SearchResponseProto.internal_static_com_dream_flink_pb_Result_descriptor;
    }

    public com.dream.flink.pb.Result getDefaultInstanceForType() {
      return com.dream.flink.pb.Result.getDefaultInstance();
    }

    public com.dream.flink.pb.Result build() {
      com.dream.flink.pb.Result result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    public com.dream.flink.pb.Result buildPartial() {
      com.dream.flink.pb.Result result = new com.dream.flink.pb.Result(this);
      int from_bitField0_ = bitField0_;
      int to_bitField0_ = 0;
      if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
        to_bitField0_ |= 0x00000001;
      }
      result.url_ = url_;
      if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
        to_bitField0_ |= 0x00000002;
      }
      result.title_ = title_;
      if (((bitField0_ & 0x00000004) == 0x00000004)) {
        snippets_ = snippets_.getUnmodifiableView();
        bitField0_ = (bitField0_ & ~0x00000004);
      }
      result.snippets_ = snippets_;
      result.bitField0_ = to_bitField0_;
      onBuilt();
      return result;
    }

    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof com.dream.flink.pb.Result) {
        return mergeFrom((com.dream.flink.pb.Result)other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.dream.flink.pb.Result other) {
      if (other == com.dream.flink.pb.Result.getDefaultInstance()) return this;
      if (other.hasUrl()) {
        bitField0_ |= 0x00000001;
        url_ = other.url_;
        onChanged();
      }
      if (other.hasTitle()) {
        bitField0_ |= 0x00000002;
        title_ = other.title_;
        onChanged();
      }
      if (!other.snippets_.isEmpty()) {
        if (snippets_.isEmpty()) {
          snippets_ = other.snippets_;
          bitField0_ = (bitField0_ & ~0x00000004);
        } else {
          ensureSnippetsIsMutable();
          snippets_.addAll(other.snippets_);
        }
        onChanged();
      }
      this.mergeUnknownFields(other.getUnknownFields());
      return this;
    }

    public final boolean isInitialized() {
      if (!hasUrl()) {
        
        return false;
      }
      if (!hasTitle()) {
        
        return false;
      }
      return true;
    }

    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      com.dream.flink.pb.Result parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (com.dream.flink.pb.Result) e.getUnfinishedMessage();
        throw e;
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }
    private int bitField0_;

    private java.lang.Object url_ = "";
    /**
     * <code>required string url = 1;</code>
     */
    public boolean hasUrl() {
      return ((bitField0_ & 0x00000001) == 0x00000001);
    }
    /**
     * <code>required string url = 1;</code>
     */
    public java.lang.String getUrl() {
      java.lang.Object ref = url_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (bs.isValidUtf8()) {
          url_ = s;
        }
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <code>required string url = 1;</code>
     */
    public com.google.protobuf.ByteString
        getUrlBytes() {
      java.lang.Object ref = url_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        url_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <code>required string url = 1;</code>
     */
    public Builder setUrl(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000001;
      url_ = value;
      onChanged();
      return this;
    }
    /**
     * <code>required string url = 1;</code>
     */
    public Builder clearUrl() {
      bitField0_ = (bitField0_ & ~0x00000001);
      url_ = getDefaultInstance().getUrl();
      onChanged();
      return this;
    }
    /**
     * <code>required string url = 1;</code>
     */
    public Builder setUrlBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000001;
      url_ = value;
      onChanged();
      return this;
    }

    private java.lang.Object title_ = "";
    /**
     * <code>required string title = 2;</code>
     */
    public boolean hasTitle() {
      return ((bitField0_ & 0x00000002) == 0x00000002);
    }
    /**
     * <code>required string title = 2;</code>
     */
    public java.lang.String getTitle() {
      java.lang.Object ref = title_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (bs.isValidUtf8()) {
          title_ = s;
        }
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <code>required string title = 2;</code>
     */
    public com.google.protobuf.ByteString
        getTitleBytes() {
      java.lang.Object ref = title_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        title_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <code>required string title = 2;</code>
     */
    public Builder setTitle(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000002;
      title_ = value;
      onChanged();
      return this;
    }
    /**
     * <code>required string title = 2;</code>
     */
    public Builder clearTitle() {
      bitField0_ = (bitField0_ & ~0x00000002);
      title_ = getDefaultInstance().getTitle();
      onChanged();
      return this;
    }
    /**
     * <code>required string title = 2;</code>
     */
    public Builder setTitleBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000002;
      title_ = value;
      onChanged();
      return this;
    }

    private com.google.protobuf.LazyStringList snippets_ = com.google.protobuf.LazyStringArrayList.EMPTY;
    private void ensureSnippetsIsMutable() {
      if (!((bitField0_ & 0x00000004) == 0x00000004)) {
        snippets_ = new com.google.protobuf.LazyStringArrayList(snippets_);
        bitField0_ |= 0x00000004;
       }
    }
    /**
     * <code>repeated string snippets = 3;</code>
     */
    public com.google.protobuf.ProtocolStringList
        getSnippetsList() {
      return snippets_.getUnmodifiableView();
    }
    /**
     * <code>repeated string snippets = 3;</code>
     */
    public int getSnippetsCount() {
      return snippets_.size();
    }
    /**
     * <code>repeated string snippets = 3;</code>
     */
    public java.lang.String getSnippets(int index) {
      return snippets_.get(index);
    }
    /**
     * <code>repeated string snippets = 3;</code>
     */
    public com.google.protobuf.ByteString
        getSnippetsBytes(int index) {
      return snippets_.getByteString(index);
    }
    /**
     * <code>repeated string snippets = 3;</code>
     */
    public Builder setSnippets(
        int index, java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  ensureSnippetsIsMutable();
      snippets_.set(index, value);
      onChanged();
      return this;
    }
    /**
     * <code>repeated string snippets = 3;</code>
     */
    public Builder addSnippets(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  ensureSnippetsIsMutable();
      snippets_.add(value);
      onChanged();
      return this;
    }
    /**
     * <code>repeated string snippets = 3;</code>
     */
    public Builder addAllSnippets(
        java.lang.Iterable<java.lang.String> values) {
      ensureSnippetsIsMutable();
      com.google.protobuf.AbstractMessageLite.Builder.addAll(
          values, snippets_);
      onChanged();
      return this;
    }
    /**
     * <code>repeated string snippets = 3;</code>
     */
    public Builder clearSnippets() {
      snippets_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      bitField0_ = (bitField0_ & ~0x00000004);
      onChanged();
      return this;
    }
    /**
     * <code>repeated string snippets = 3;</code>
     */
    public Builder addSnippetsBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  ensureSnippetsIsMutable();
      snippets_.add(value);
      onChanged();
      return this;
    }

    // @@protoc_insertion_point(builder_scope:com.dream.flink.pb.Result)
  }

  static {
    defaultInstance = new Result(true);
    defaultInstance.initFields();
  }

  // @@protoc_insertion_point(class_scope:com.dream.flink.pb.Result)
}

