// @generated
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: src/com/facebook/buck/downwardapi/resources/proto/downward_api.proto

package com.facebook.buck.downward.model;

/**
 * Protobuf type {@code downward.api.v1.LogEvent}
 */
@javax.annotation.Generated(value="protoc", comments="annotations:LogEvent.java.pb.meta")
public  final class LogEvent extends
    com.google.protobuf.GeneratedMessageV3 implements
    // @@protoc_insertion_point(message_implements:downward.api.v1.LogEvent)
    LogEventOrBuilder {
private static final long serialVersionUID = 0L;
  // Use LogEvent.newBuilder() to construct.
  private LogEvent(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }
  private LogEvent() {
    logLevel_ = 0;
    message_ = "";
    loggerName_ = "";
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet
  getUnknownFields() {
    return this.unknownFields;
  }
  private LogEvent(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    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;
          case 8: {
            int rawValue = input.readEnum();

            logLevel_ = rawValue;
            break;
          }
          case 18: {
            java.lang.String s = input.readStringRequireUtf8();

            message_ = s;
            break;
          }
          case 26: {
            java.lang.String s = input.readStringRequireUtf8();

            loggerName_ = s;
            break;
          }
          default: {
            if (!parseUnknownField(
                input, unknownFields, extensionRegistry, tag)) {
              done = true;
            }
            break;
          }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(
          e).setUnfinishedMessage(this);
    } finally {
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }
  public static final com.google.protobuf.Descriptors.Descriptor
      getDescriptor() {
    return com.facebook.buck.downward.model.DownwardAPIProto.internal_static_downward_api_v1_LogEvent_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.facebook.buck.downward.model.DownwardAPIProto.internal_static_downward_api_v1_LogEvent_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.facebook.buck.downward.model.LogEvent.class, com.facebook.buck.downward.model.LogEvent.Builder.class);
  }

  public static final int LOG_LEVEL_FIELD_NUMBER = 1;
  private int logLevel_;
  /**
   * <code>.downward.api.v1.LogLevel log_level = 1;</code>
   */
  public int getLogLevelValue() {
    return logLevel_;
  }
  /**
   * <code>.downward.api.v1.LogLevel log_level = 1;</code>
   */
  public com.facebook.buck.downward.model.LogLevel getLogLevel() {
    @SuppressWarnings("deprecation")
    com.facebook.buck.downward.model.LogLevel result = com.facebook.buck.downward.model.LogLevel.valueOf(logLevel_);
    return result == null ? com.facebook.buck.downward.model.LogLevel.UNRECOGNIZED : result;
  }

  public static final int MESSAGE_FIELD_NUMBER = 2;
  private volatile java.lang.Object message_;
  /**
   * <code>string message = 2;</code>
   */
  public java.lang.String getMessage() {
    java.lang.Object ref = message_;
    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();
      message_ = s;
      return s;
    }
  }
  /**
   * <code>string message = 2;</code>
   */
  public com.google.protobuf.ByteString
      getMessageBytes() {
    java.lang.Object ref = message_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      message_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int LOGGER_NAME_FIELD_NUMBER = 3;
  private volatile java.lang.Object loggerName_;
  /**
   * <code>string logger_name = 3;</code>
   */
  public java.lang.String getLoggerName() {
    java.lang.Object ref = loggerName_;
    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();
      loggerName_ = s;
      return s;
    }
  }
  /**
   * <code>string logger_name = 3;</code>
   */
  public com.google.protobuf.ByteString
      getLoggerNameBytes() {
    java.lang.Object ref = loggerName_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      loggerName_ = 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 (logLevel_ != com.facebook.buck.downward.model.LogLevel.UNKNOWN.getNumber()) {
      output.writeEnum(1, logLevel_);
    }
    if (!getMessageBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, message_);
    }
    if (!getLoggerNameBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 3, loggerName_);
    }
    unknownFields.writeTo(output);
  }

  @java.lang.Override
  public int getSerializedSize() {
    int size = memoizedSize;
    if (size != -1) return size;

    size = 0;
    if (logLevel_ != com.facebook.buck.downward.model.LogLevel.UNKNOWN.getNumber()) {
      size += com.google.protobuf.CodedOutputStream
        .computeEnumSize(1, logLevel_);
    }
    if (!getMessageBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, message_);
    }
    if (!getLoggerNameBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, loggerName_);
    }
    size += unknownFields.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.facebook.buck.downward.model.LogEvent)) {
      return super.equals(obj);
    }
    com.facebook.buck.downward.model.LogEvent other = (com.facebook.buck.downward.model.LogEvent) obj;

    if (logLevel_ != other.logLevel_) return false;
    if (!getMessage()
        .equals(other.getMessage())) return false;
    if (!getLoggerName()
        .equals(other.getLoggerName())) return false;
    if (!unknownFields.equals(other.unknownFields)) 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) + LOG_LEVEL_FIELD_NUMBER;
    hash = (53 * hash) + logLevel_;
    hash = (37 * hash) + MESSAGE_FIELD_NUMBER;
    hash = (53 * hash) + getMessage().hashCode();
    hash = (37 * hash) + LOGGER_NAME_FIELD_NUMBER;
    hash = (53 * hash) + getLoggerName().hashCode();
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.facebook.buck.downward.model.LogEvent parseFrom(
      java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.facebook.buck.downward.model.LogEvent parseFrom(
      java.nio.ByteBuffer data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.facebook.buck.downward.model.LogEvent parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.facebook.buck.downward.model.LogEvent parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.facebook.buck.downward.model.LogEvent parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.facebook.buck.downward.model.LogEvent parseFrom(
      byte[] data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.facebook.buck.downward.model.LogEvent parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static com.facebook.buck.downward.model.LogEvent 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.facebook.buck.downward.model.LogEvent parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input);
  }
  public static com.facebook.buck.downward.model.LogEvent 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.facebook.buck.downward.model.LogEvent parseFrom(
      com.google.protobuf.CodedInputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static com.facebook.buck.downward.model.LogEvent 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.facebook.buck.downward.model.LogEvent 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 downward.api.v1.LogEvent}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
      // @@protoc_insertion_point(builder_implements:downward.api.v1.LogEvent)
      com.facebook.buck.downward.model.LogEventOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return com.facebook.buck.downward.model.DownwardAPIProto.internal_static_downward_api_v1_LogEvent_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.facebook.buck.downward.model.DownwardAPIProto.internal_static_downward_api_v1_LogEvent_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.facebook.buck.downward.model.LogEvent.class, com.facebook.buck.downward.model.LogEvent.Builder.class);
    }

    // Construct using com.facebook.buck.downward.model.LogEvent.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

    private Builder(
        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
      maybeForceBuilderInitialization();
    }
    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3
              .alwaysUseFieldBuilders) {
      }
    }
    @java.lang.Override
    public Builder clear() {
      super.clear();
      logLevel_ = 0;

      message_ = "";

      loggerName_ = "";

      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor
        getDescriptorForType() {
      return com.facebook.buck.downward.model.DownwardAPIProto.internal_static_downward_api_v1_LogEvent_descriptor;
    }

    @java.lang.Override
    public com.facebook.buck.downward.model.LogEvent getDefaultInstanceForType() {
      return com.facebook.buck.downward.model.LogEvent.getDefaultInstance();
    }

    @java.lang.Override
    public com.facebook.buck.downward.model.LogEvent build() {
      com.facebook.buck.downward.model.LogEvent result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public com.facebook.buck.downward.model.LogEvent buildPartial() {
      com.facebook.buck.downward.model.LogEvent result = new com.facebook.buck.downward.model.LogEvent(this);
      result.logLevel_ = logLevel_;
      result.message_ = message_;
      result.loggerName_ = loggerName_;
      onBuilt();
      return result;
    }

    @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.facebook.buck.downward.model.LogEvent) {
        return mergeFrom((com.facebook.buck.downward.model.LogEvent)other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.facebook.buck.downward.model.LogEvent other) {
      if (other == com.facebook.buck.downward.model.LogEvent.getDefaultInstance()) return this;
      if (other.logLevel_ != 0) {
        setLogLevelValue(other.getLogLevelValue());
      }
      if (!other.getMessage().isEmpty()) {
        message_ = other.message_;
        onChanged();
      }
      if (!other.getLoggerName().isEmpty()) {
        loggerName_ = other.loggerName_;
        onChanged();
      }
      this.mergeUnknownFields(other.unknownFields);
      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 {
      com.facebook.buck.downward.model.LogEvent parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (com.facebook.buck.downward.model.LogEvent) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private int logLevel_ = 0;
    /**
     * <code>.downward.api.v1.LogLevel log_level = 1;</code>
     */
    public int getLogLevelValue() {
      return logLevel_;
    }
    /**
     * <code>.downward.api.v1.LogLevel log_level = 1;</code>
     */
    public Builder setLogLevelValue(int value) {
      logLevel_ = value;
      onChanged();
      return this;
    }
    /**
     * <code>.downward.api.v1.LogLevel log_level = 1;</code>
     */
    public com.facebook.buck.downward.model.LogLevel getLogLevel() {
      @SuppressWarnings("deprecation")
      com.facebook.buck.downward.model.LogLevel result = com.facebook.buck.downward.model.LogLevel.valueOf(logLevel_);
      return result == null ? com.facebook.buck.downward.model.LogLevel.UNRECOGNIZED : result;
    }
    /**
     * <code>.downward.api.v1.LogLevel log_level = 1;</code>
     */
    public Builder setLogLevel(com.facebook.buck.downward.model.LogLevel value) {
      if (value == null) {
        throw new NullPointerException();
      }
      
      logLevel_ = value.getNumber();
      onChanged();
      return this;
    }
    /**
     * <code>.downward.api.v1.LogLevel log_level = 1;</code>
     */
    public Builder clearLogLevel() {
      
      logLevel_ = 0;
      onChanged();
      return this;
    }

    private java.lang.Object message_ = "";
    /**
     * <code>string message = 2;</code>
     */
    public java.lang.String getMessage() {
      java.lang.Object ref = message_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        message_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <code>string message = 2;</code>
     */
    public com.google.protobuf.ByteString
        getMessageBytes() {
      java.lang.Object ref = message_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        message_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <code>string message = 2;</code>
     */
    public Builder setMessage(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      message_ = value;
      onChanged();
      return this;
    }
    /**
     * <code>string message = 2;</code>
     */
    public Builder clearMessage() {
      
      message_ = getDefaultInstance().getMessage();
      onChanged();
      return this;
    }
    /**
     * <code>string message = 2;</code>
     */
    public Builder setMessageBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      message_ = value;
      onChanged();
      return this;
    }

    private java.lang.Object loggerName_ = "";
    /**
     * <code>string logger_name = 3;</code>
     */
    public java.lang.String getLoggerName() {
      java.lang.Object ref = loggerName_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        loggerName_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <code>string logger_name = 3;</code>
     */
    public com.google.protobuf.ByteString
        getLoggerNameBytes() {
      java.lang.Object ref = loggerName_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        loggerName_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <code>string logger_name = 3;</code>
     */
    public Builder setLoggerName(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      loggerName_ = value;
      onChanged();
      return this;
    }
    /**
     * <code>string logger_name = 3;</code>
     */
    public Builder clearLoggerName() {
      
      loggerName_ = getDefaultInstance().getLoggerName();
      onChanged();
      return this;
    }
    /**
     * <code>string logger_name = 3;</code>
     */
    public Builder setLoggerNameBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      loggerName_ = value;
      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:downward.api.v1.LogEvent)
  }

  // @@protoc_insertion_point(class_scope:downward.api.v1.LogEvent)
  private static final com.facebook.buck.downward.model.LogEvent DEFAULT_INSTANCE;
  static {
    DEFAULT_INSTANCE = new com.facebook.buck.downward.model.LogEvent();
  }

  public static com.facebook.buck.downward.model.LogEvent getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<LogEvent>
      PARSER = new com.google.protobuf.AbstractParser<LogEvent>() {
    @java.lang.Override
    public LogEvent parsePartialFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return new LogEvent(input, extensionRegistry);
    }
  };

  public static com.google.protobuf.Parser<LogEvent> parser() {
    return PARSER;
  }

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

  @java.lang.Override
  public com.facebook.buck.downward.model.LogEvent getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }

}

