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

package com.facebook.buck.remoteexecution.proto;

/**
 * <pre>
 * minimal worker requirements which should be satisfied to execute a given action
 * </pre>
 *
 * Protobuf type {@code facebook.remote_execution.WorkerRequirements}
 */
@javax.annotation.Generated(value="protoc", comments="annotations:WorkerRequirements.java.pb.meta")
public  final class WorkerRequirements extends
    com.google.protobuf.GeneratedMessageV3 implements
    // @@protoc_insertion_point(message_implements:facebook.remote_execution.WorkerRequirements)
    WorkerRequirementsOrBuilder {
private static final long serialVersionUID = 0L;
  // Use WorkerRequirements.newBuilder() to construct.
  private WorkerRequirements(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }
  private WorkerRequirements() {
    workerSize_ = 0;
    platformType_ = 0;
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet
  getUnknownFields() {
    return this.unknownFields;
  }
  private WorkerRequirements(
      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();

            workerSize_ = rawValue;
            break;
          }
          case 16: {
            int rawValue = input.readEnum();

            platformType_ = rawValue;
            break;
          }
          case 24: {

            shouldTryLargerWorkerOnOom_ = input.readBool();
            break;
          }
          case 34: {
            com.facebook.buck.remoteexecution.proto.CapabilityValue.Builder subBuilder = null;
            if (testing_ != null) {
              subBuilder = testing_.toBuilder();
            }
            testing_ = input.readMessage(com.facebook.buck.remoteexecution.proto.CapabilityValue.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(testing_);
              testing_ = subBuilder.buildPartial();
            }

            break;
          }
          case 42: {
            com.facebook.buck.remoteexecution.proto.CapabilityValue.Builder subBuilder = null;
            if (taskName_ != null) {
              subBuilder = taskName_.toBuilder();
            }
            taskName_ = input.readMessage(com.facebook.buck.remoteexecution.proto.CapabilityValue.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(taskName_);
              taskName_ = subBuilder.buildPartial();
            }

            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.remoteexecution.proto.RemoteExecutionMetadataProto.internal_static_facebook_remote_execution_WorkerRequirements_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.facebook.buck.remoteexecution.proto.RemoteExecutionMetadataProto.internal_static_facebook_remote_execution_WorkerRequirements_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.facebook.buck.remoteexecution.proto.WorkerRequirements.class, com.facebook.buck.remoteexecution.proto.WorkerRequirements.Builder.class);
  }

  /**
   * Protobuf enum {@code facebook.remote_execution.WorkerRequirements.WorkerPlatformType}
   */
  public enum WorkerPlatformType
      implements com.google.protobuf.ProtocolMessageEnum {
    /**
     * <code>LINUX = 0;</code>
     */
    LINUX(0),
    /**
     * <code>ANDROID_EMULATOR = 1;</code>
     */
    ANDROID_EMULATOR(1),
    UNRECOGNIZED(-1),
    ;

    /**
     * <code>LINUX = 0;</code>
     */
    public static final int LINUX_VALUE = 0;
    /**
     * <code>ANDROID_EMULATOR = 1;</code>
     */
    public static final int ANDROID_EMULATOR_VALUE = 1;


    public final int getNumber() {
      if (this == UNRECOGNIZED) {
        throw new java.lang.IllegalArgumentException(
            "Can't get the number of an unknown enum value.");
      }
      return value;
    }

    /**
     * @deprecated Use {@link #forNumber(int)} instead.
     */
    @java.lang.Deprecated
    public static WorkerPlatformType valueOf(int value) {
      return forNumber(value);
    }

    public static WorkerPlatformType forNumber(int value) {
      switch (value) {
        case 0: return LINUX;
        case 1: return ANDROID_EMULATOR;
        default: return null;
      }
    }

    public static com.google.protobuf.Internal.EnumLiteMap<WorkerPlatformType>
        internalGetValueMap() {
      return internalValueMap;
    }
    private static final com.google.protobuf.Internal.EnumLiteMap<
        WorkerPlatformType> internalValueMap =
          new com.google.protobuf.Internal.EnumLiteMap<WorkerPlatformType>() {
            public WorkerPlatformType findValueByNumber(int number) {
              return WorkerPlatformType.forNumber(number);
            }
          };

    public final com.google.protobuf.Descriptors.EnumValueDescriptor
        getValueDescriptor() {
      return getDescriptor().getValues().get(ordinal());
    }
    public final com.google.protobuf.Descriptors.EnumDescriptor
        getDescriptorForType() {
      return getDescriptor();
    }
    public static final com.google.protobuf.Descriptors.EnumDescriptor
        getDescriptor() {
      return com.facebook.buck.remoteexecution.proto.WorkerRequirements.getDescriptor().getEnumTypes().get(0);
    }

    private static final WorkerPlatformType[] VALUES = values();

    public static WorkerPlatformType valueOf(
        com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
      if (desc.getType() != getDescriptor()) {
        throw new java.lang.IllegalArgumentException(
          "EnumValueDescriptor is not for this type.");
      }
      if (desc.getIndex() == -1) {
        return UNRECOGNIZED;
      }
      return VALUES[desc.getIndex()];
    }

    private final int value;

    private WorkerPlatformType(int value) {
      this.value = value;
    }

    // @@protoc_insertion_point(enum_scope:facebook.remote_execution.WorkerRequirements.WorkerPlatformType)
  }

  /**
   * Protobuf enum {@code facebook.remote_execution.WorkerRequirements.WorkerSize}
   */
  public enum WorkerSize
      implements com.google.protobuf.ProtocolMessageEnum {
    /**
     * <code>SMALL = 0;</code>
     */
    SMALL(0),
    /**
     * <code>MEDIUM = 1;</code>
     */
    MEDIUM(1),
    /**
     * <code>LARGE = 2;</code>
     */
    LARGE(2),
    /**
     * <code>XLARGE = 3;</code>
     */
    XLARGE(3),
    /**
     * <code>XXLARGE = 4;</code>
     */
    XXLARGE(4),
    UNRECOGNIZED(-1),
    ;

    /**
     * <code>SMALL = 0;</code>
     */
    public static final int SMALL_VALUE = 0;
    /**
     * <code>MEDIUM = 1;</code>
     */
    public static final int MEDIUM_VALUE = 1;
    /**
     * <code>LARGE = 2;</code>
     */
    public static final int LARGE_VALUE = 2;
    /**
     * <code>XLARGE = 3;</code>
     */
    public static final int XLARGE_VALUE = 3;
    /**
     * <code>XXLARGE = 4;</code>
     */
    public static final int XXLARGE_VALUE = 4;


    public final int getNumber() {
      if (this == UNRECOGNIZED) {
        throw new java.lang.IllegalArgumentException(
            "Can't get the number of an unknown enum value.");
      }
      return value;
    }

    /**
     * @deprecated Use {@link #forNumber(int)} instead.
     */
    @java.lang.Deprecated
    public static WorkerSize valueOf(int value) {
      return forNumber(value);
    }

    public static WorkerSize forNumber(int value) {
      switch (value) {
        case 0: return SMALL;
        case 1: return MEDIUM;
        case 2: return LARGE;
        case 3: return XLARGE;
        case 4: return XXLARGE;
        default: return null;
      }
    }

    public static com.google.protobuf.Internal.EnumLiteMap<WorkerSize>
        internalGetValueMap() {
      return internalValueMap;
    }
    private static final com.google.protobuf.Internal.EnumLiteMap<
        WorkerSize> internalValueMap =
          new com.google.protobuf.Internal.EnumLiteMap<WorkerSize>() {
            public WorkerSize findValueByNumber(int number) {
              return WorkerSize.forNumber(number);
            }
          };

    public final com.google.protobuf.Descriptors.EnumValueDescriptor
        getValueDescriptor() {
      return getDescriptor().getValues().get(ordinal());
    }
    public final com.google.protobuf.Descriptors.EnumDescriptor
        getDescriptorForType() {
      return getDescriptor();
    }
    public static final com.google.protobuf.Descriptors.EnumDescriptor
        getDescriptor() {
      return com.facebook.buck.remoteexecution.proto.WorkerRequirements.getDescriptor().getEnumTypes().get(1);
    }

    private static final WorkerSize[] VALUES = values();

    public static WorkerSize valueOf(
        com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
      if (desc.getType() != getDescriptor()) {
        throw new java.lang.IllegalArgumentException(
          "EnumValueDescriptor is not for this type.");
      }
      if (desc.getIndex() == -1) {
        return UNRECOGNIZED;
      }
      return VALUES[desc.getIndex()];
    }

    private final int value;

    private WorkerSize(int value) {
      this.value = value;
    }

    // @@protoc_insertion_point(enum_scope:facebook.remote_execution.WorkerRequirements.WorkerSize)
  }

  public static final int WORKER_SIZE_FIELD_NUMBER = 1;
  private int workerSize_;
  /**
   * <code>.facebook.remote_execution.WorkerRequirements.WorkerSize worker_size = 1;</code>
   */
  public int getWorkerSizeValue() {
    return workerSize_;
  }
  /**
   * <code>.facebook.remote_execution.WorkerRequirements.WorkerSize worker_size = 1;</code>
   */
  public com.facebook.buck.remoteexecution.proto.WorkerRequirements.WorkerSize getWorkerSize() {
    @SuppressWarnings("deprecation")
    com.facebook.buck.remoteexecution.proto.WorkerRequirements.WorkerSize result = com.facebook.buck.remoteexecution.proto.WorkerRequirements.WorkerSize.valueOf(workerSize_);
    return result == null ? com.facebook.buck.remoteexecution.proto.WorkerRequirements.WorkerSize.UNRECOGNIZED : result;
  }

  public static final int PLATFORM_TYPE_FIELD_NUMBER = 2;
  private int platformType_;
  /**
   * <code>.facebook.remote_execution.WorkerRequirements.WorkerPlatformType platform_type = 2;</code>
   */
  public int getPlatformTypeValue() {
    return platformType_;
  }
  /**
   * <code>.facebook.remote_execution.WorkerRequirements.WorkerPlatformType platform_type = 2;</code>
   */
  public com.facebook.buck.remoteexecution.proto.WorkerRequirements.WorkerPlatformType getPlatformType() {
    @SuppressWarnings("deprecation")
    com.facebook.buck.remoteexecution.proto.WorkerRequirements.WorkerPlatformType result = com.facebook.buck.remoteexecution.proto.WorkerRequirements.WorkerPlatformType.valueOf(platformType_);
    return result == null ? com.facebook.buck.remoteexecution.proto.WorkerRequirements.WorkerPlatformType.UNRECOGNIZED : result;
  }

  public static final int SHOULD_TRY_LARGER_WORKER_ON_OOM_FIELD_NUMBER = 3;
  private boolean shouldTryLargerWorkerOnOom_;
  /**
   * <pre>
   * Indicates if execution engine should try to execute current action with more powerful requirements
   * </pre>
   *
   * <code>bool should_try_larger_worker_on_oom = 3;</code>
   */
  public boolean getShouldTryLargerWorkerOnOom() {
    return shouldTryLargerWorkerOnOom_;
  }

  public static final int TESTING_FIELD_NUMBER = 4;
  private com.facebook.buck.remoteexecution.proto.CapabilityValue testing_;
  /**
   * <pre>
   * Canaried workers have a "testing" capability (with a random value). This
   * should be set when we want the request to go to a specific canaried worker.
   * </pre>
   *
   * <code>.facebook.remote_execution.CapabilityValue testing = 4;</code>
   */
  public boolean hasTesting() {
    return testing_ != null;
  }
  /**
   * <pre>
   * Canaried workers have a "testing" capability (with a random value). This
   * should be set when we want the request to go to a specific canaried worker.
   * </pre>
   *
   * <code>.facebook.remote_execution.CapabilityValue testing = 4;</code>
   */
  public com.facebook.buck.remoteexecution.proto.CapabilityValue getTesting() {
    return testing_ == null ? com.facebook.buck.remoteexecution.proto.CapabilityValue.getDefaultInstance() : testing_;
  }
  /**
   * <pre>
   * Canaried workers have a "testing" capability (with a random value). This
   * should be set when we want the request to go to a specific canaried worker.
   * </pre>
   *
   * <code>.facebook.remote_execution.CapabilityValue testing = 4;</code>
   */
  public com.facebook.buck.remoteexecution.proto.CapabilityValueOrBuilder getTestingOrBuilder() {
    return getTesting();
  }

  public static final int TASK_NAME_FIELD_NUMBER = 5;
  private com.facebook.buck.remoteexecution.proto.CapabilityValue taskName_;
  /**
   * <code>.facebook.remote_execution.CapabilityValue task_name = 5;</code>
   */
  public boolean hasTaskName() {
    return taskName_ != null;
  }
  /**
   * <code>.facebook.remote_execution.CapabilityValue task_name = 5;</code>
   */
  public com.facebook.buck.remoteexecution.proto.CapabilityValue getTaskName() {
    return taskName_ == null ? com.facebook.buck.remoteexecution.proto.CapabilityValue.getDefaultInstance() : taskName_;
  }
  /**
   * <code>.facebook.remote_execution.CapabilityValue task_name = 5;</code>
   */
  public com.facebook.buck.remoteexecution.proto.CapabilityValueOrBuilder getTaskNameOrBuilder() {
    return getTaskName();
  }

  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 (workerSize_ != com.facebook.buck.remoteexecution.proto.WorkerRequirements.WorkerSize.SMALL.getNumber()) {
      output.writeEnum(1, workerSize_);
    }
    if (platformType_ != com.facebook.buck.remoteexecution.proto.WorkerRequirements.WorkerPlatformType.LINUX.getNumber()) {
      output.writeEnum(2, platformType_);
    }
    if (shouldTryLargerWorkerOnOom_ != false) {
      output.writeBool(3, shouldTryLargerWorkerOnOom_);
    }
    if (testing_ != null) {
      output.writeMessage(4, getTesting());
    }
    if (taskName_ != null) {
      output.writeMessage(5, getTaskName());
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    if (workerSize_ != com.facebook.buck.remoteexecution.proto.WorkerRequirements.WorkerSize.SMALL.getNumber()) {
      size += com.google.protobuf.CodedOutputStream
        .computeEnumSize(1, workerSize_);
    }
    if (platformType_ != com.facebook.buck.remoteexecution.proto.WorkerRequirements.WorkerPlatformType.LINUX.getNumber()) {
      size += com.google.protobuf.CodedOutputStream
        .computeEnumSize(2, platformType_);
    }
    if (shouldTryLargerWorkerOnOom_ != false) {
      size += com.google.protobuf.CodedOutputStream
        .computeBoolSize(3, shouldTryLargerWorkerOnOom_);
    }
    if (testing_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(4, getTesting());
    }
    if (taskName_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(5, getTaskName());
    }
    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.remoteexecution.proto.WorkerRequirements)) {
      return super.equals(obj);
    }
    com.facebook.buck.remoteexecution.proto.WorkerRequirements other = (com.facebook.buck.remoteexecution.proto.WorkerRequirements) obj;

    if (workerSize_ != other.workerSize_) return false;
    if (platformType_ != other.platformType_) return false;
    if (getShouldTryLargerWorkerOnOom()
        != other.getShouldTryLargerWorkerOnOom()) return false;
    if (hasTesting() != other.hasTesting()) return false;
    if (hasTesting()) {
      if (!getTesting()
          .equals(other.getTesting())) return false;
    }
    if (hasTaskName() != other.hasTaskName()) return false;
    if (hasTaskName()) {
      if (!getTaskName()
          .equals(other.getTaskName())) 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) + WORKER_SIZE_FIELD_NUMBER;
    hash = (53 * hash) + workerSize_;
    hash = (37 * hash) + PLATFORM_TYPE_FIELD_NUMBER;
    hash = (53 * hash) + platformType_;
    hash = (37 * hash) + SHOULD_TRY_LARGER_WORKER_ON_OOM_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
        getShouldTryLargerWorkerOnOom());
    if (hasTesting()) {
      hash = (37 * hash) + TESTING_FIELD_NUMBER;
      hash = (53 * hash) + getTesting().hashCode();
    }
    if (hasTaskName()) {
      hash = (37 * hash) + TASK_NAME_FIELD_NUMBER;
      hash = (53 * hash) + getTaskName().hashCode();
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.facebook.buck.remoteexecution.proto.WorkerRequirements parseFrom(
      java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.facebook.buck.remoteexecution.proto.WorkerRequirements 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.remoteexecution.proto.WorkerRequirements parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.facebook.buck.remoteexecution.proto.WorkerRequirements 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.remoteexecution.proto.WorkerRequirements parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.facebook.buck.remoteexecution.proto.WorkerRequirements parseFrom(
      byte[] data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.facebook.buck.remoteexecution.proto.WorkerRequirements parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static com.facebook.buck.remoteexecution.proto.WorkerRequirements 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.remoteexecution.proto.WorkerRequirements parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input);
  }
  public static com.facebook.buck.remoteexecution.proto.WorkerRequirements 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.remoteexecution.proto.WorkerRequirements parseFrom(
      com.google.protobuf.CodedInputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static com.facebook.buck.remoteexecution.proto.WorkerRequirements 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.remoteexecution.proto.WorkerRequirements 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;
  }
  /**
   * <pre>
   * minimal worker requirements which should be satisfied to execute a given action
   * </pre>
   *
   * Protobuf type {@code facebook.remote_execution.WorkerRequirements}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
      // @@protoc_insertion_point(builder_implements:facebook.remote_execution.WorkerRequirements)
      com.facebook.buck.remoteexecution.proto.WorkerRequirementsOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return com.facebook.buck.remoteexecution.proto.RemoteExecutionMetadataProto.internal_static_facebook_remote_execution_WorkerRequirements_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.facebook.buck.remoteexecution.proto.RemoteExecutionMetadataProto.internal_static_facebook_remote_execution_WorkerRequirements_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.facebook.buck.remoteexecution.proto.WorkerRequirements.class, com.facebook.buck.remoteexecution.proto.WorkerRequirements.Builder.class);
    }

    // Construct using com.facebook.buck.remoteexecution.proto.WorkerRequirements.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();
      workerSize_ = 0;

      platformType_ = 0;

      shouldTryLargerWorkerOnOom_ = false;

      if (testingBuilder_ == null) {
        testing_ = null;
      } else {
        testing_ = null;
        testingBuilder_ = null;
      }
      if (taskNameBuilder_ == null) {
        taskName_ = null;
      } else {
        taskName_ = null;
        taskNameBuilder_ = null;
      }
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor
        getDescriptorForType() {
      return com.facebook.buck.remoteexecution.proto.RemoteExecutionMetadataProto.internal_static_facebook_remote_execution_WorkerRequirements_descriptor;
    }

    @java.lang.Override
    public com.facebook.buck.remoteexecution.proto.WorkerRequirements getDefaultInstanceForType() {
      return com.facebook.buck.remoteexecution.proto.WorkerRequirements.getDefaultInstance();
    }

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

    @java.lang.Override
    public com.facebook.buck.remoteexecution.proto.WorkerRequirements buildPartial() {
      com.facebook.buck.remoteexecution.proto.WorkerRequirements result = new com.facebook.buck.remoteexecution.proto.WorkerRequirements(this);
      result.workerSize_ = workerSize_;
      result.platformType_ = platformType_;
      result.shouldTryLargerWorkerOnOom_ = shouldTryLargerWorkerOnOom_;
      if (testingBuilder_ == null) {
        result.testing_ = testing_;
      } else {
        result.testing_ = testingBuilder_.build();
      }
      if (taskNameBuilder_ == null) {
        result.taskName_ = taskName_;
      } else {
        result.taskName_ = taskNameBuilder_.build();
      }
      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.remoteexecution.proto.WorkerRequirements) {
        return mergeFrom((com.facebook.buck.remoteexecution.proto.WorkerRequirements)other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.facebook.buck.remoteexecution.proto.WorkerRequirements other) {
      if (other == com.facebook.buck.remoteexecution.proto.WorkerRequirements.getDefaultInstance()) return this;
      if (other.workerSize_ != 0) {
        setWorkerSizeValue(other.getWorkerSizeValue());
      }
      if (other.platformType_ != 0) {
        setPlatformTypeValue(other.getPlatformTypeValue());
      }
      if (other.getShouldTryLargerWorkerOnOom() != false) {
        setShouldTryLargerWorkerOnOom(other.getShouldTryLargerWorkerOnOom());
      }
      if (other.hasTesting()) {
        mergeTesting(other.getTesting());
      }
      if (other.hasTaskName()) {
        mergeTaskName(other.getTaskName());
      }
      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.remoteexecution.proto.WorkerRequirements parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (com.facebook.buck.remoteexecution.proto.WorkerRequirements) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private int workerSize_ = 0;
    /**
     * <code>.facebook.remote_execution.WorkerRequirements.WorkerSize worker_size = 1;</code>
     */
    public int getWorkerSizeValue() {
      return workerSize_;
    }
    /**
     * <code>.facebook.remote_execution.WorkerRequirements.WorkerSize worker_size = 1;</code>
     */
    public Builder setWorkerSizeValue(int value) {
      workerSize_ = value;
      onChanged();
      return this;
    }
    /**
     * <code>.facebook.remote_execution.WorkerRequirements.WorkerSize worker_size = 1;</code>
     */
    public com.facebook.buck.remoteexecution.proto.WorkerRequirements.WorkerSize getWorkerSize() {
      @SuppressWarnings("deprecation")
      com.facebook.buck.remoteexecution.proto.WorkerRequirements.WorkerSize result = com.facebook.buck.remoteexecution.proto.WorkerRequirements.WorkerSize.valueOf(workerSize_);
      return result == null ? com.facebook.buck.remoteexecution.proto.WorkerRequirements.WorkerSize.UNRECOGNIZED : result;
    }
    /**
     * <code>.facebook.remote_execution.WorkerRequirements.WorkerSize worker_size = 1;</code>
     */
    public Builder setWorkerSize(com.facebook.buck.remoteexecution.proto.WorkerRequirements.WorkerSize value) {
      if (value == null) {
        throw new NullPointerException();
      }
      
      workerSize_ = value.getNumber();
      onChanged();
      return this;
    }
    /**
     * <code>.facebook.remote_execution.WorkerRequirements.WorkerSize worker_size = 1;</code>
     */
    public Builder clearWorkerSize() {
      
      workerSize_ = 0;
      onChanged();
      return this;
    }

    private int platformType_ = 0;
    /**
     * <code>.facebook.remote_execution.WorkerRequirements.WorkerPlatformType platform_type = 2;</code>
     */
    public int getPlatformTypeValue() {
      return platformType_;
    }
    /**
     * <code>.facebook.remote_execution.WorkerRequirements.WorkerPlatformType platform_type = 2;</code>
     */
    public Builder setPlatformTypeValue(int value) {
      platformType_ = value;
      onChanged();
      return this;
    }
    /**
     * <code>.facebook.remote_execution.WorkerRequirements.WorkerPlatformType platform_type = 2;</code>
     */
    public com.facebook.buck.remoteexecution.proto.WorkerRequirements.WorkerPlatformType getPlatformType() {
      @SuppressWarnings("deprecation")
      com.facebook.buck.remoteexecution.proto.WorkerRequirements.WorkerPlatformType result = com.facebook.buck.remoteexecution.proto.WorkerRequirements.WorkerPlatformType.valueOf(platformType_);
      return result == null ? com.facebook.buck.remoteexecution.proto.WorkerRequirements.WorkerPlatformType.UNRECOGNIZED : result;
    }
    /**
     * <code>.facebook.remote_execution.WorkerRequirements.WorkerPlatformType platform_type = 2;</code>
     */
    public Builder setPlatformType(com.facebook.buck.remoteexecution.proto.WorkerRequirements.WorkerPlatformType value) {
      if (value == null) {
        throw new NullPointerException();
      }
      
      platformType_ = value.getNumber();
      onChanged();
      return this;
    }
    /**
     * <code>.facebook.remote_execution.WorkerRequirements.WorkerPlatformType platform_type = 2;</code>
     */
    public Builder clearPlatformType() {
      
      platformType_ = 0;
      onChanged();
      return this;
    }

    private boolean shouldTryLargerWorkerOnOom_ ;
    /**
     * <pre>
     * Indicates if execution engine should try to execute current action with more powerful requirements
     * </pre>
     *
     * <code>bool should_try_larger_worker_on_oom = 3;</code>
     */
    public boolean getShouldTryLargerWorkerOnOom() {
      return shouldTryLargerWorkerOnOom_;
    }
    /**
     * <pre>
     * Indicates if execution engine should try to execute current action with more powerful requirements
     * </pre>
     *
     * <code>bool should_try_larger_worker_on_oom = 3;</code>
     */
    public Builder setShouldTryLargerWorkerOnOom(boolean value) {
      
      shouldTryLargerWorkerOnOom_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Indicates if execution engine should try to execute current action with more powerful requirements
     * </pre>
     *
     * <code>bool should_try_larger_worker_on_oom = 3;</code>
     */
    public Builder clearShouldTryLargerWorkerOnOom() {
      
      shouldTryLargerWorkerOnOom_ = false;
      onChanged();
      return this;
    }

    private com.facebook.buck.remoteexecution.proto.CapabilityValue testing_;
    private com.google.protobuf.SingleFieldBuilderV3<
        com.facebook.buck.remoteexecution.proto.CapabilityValue, com.facebook.buck.remoteexecution.proto.CapabilityValue.Builder, com.facebook.buck.remoteexecution.proto.CapabilityValueOrBuilder> testingBuilder_;
    /**
     * <pre>
     * Canaried workers have a "testing" capability (with a random value). This
     * should be set when we want the request to go to a specific canaried worker.
     * </pre>
     *
     * <code>.facebook.remote_execution.CapabilityValue testing = 4;</code>
     */
    public boolean hasTesting() {
      return testingBuilder_ != null || testing_ != null;
    }
    /**
     * <pre>
     * Canaried workers have a "testing" capability (with a random value). This
     * should be set when we want the request to go to a specific canaried worker.
     * </pre>
     *
     * <code>.facebook.remote_execution.CapabilityValue testing = 4;</code>
     */
    public com.facebook.buck.remoteexecution.proto.CapabilityValue getTesting() {
      if (testingBuilder_ == null) {
        return testing_ == null ? com.facebook.buck.remoteexecution.proto.CapabilityValue.getDefaultInstance() : testing_;
      } else {
        return testingBuilder_.getMessage();
      }
    }
    /**
     * <pre>
     * Canaried workers have a "testing" capability (with a random value). This
     * should be set when we want the request to go to a specific canaried worker.
     * </pre>
     *
     * <code>.facebook.remote_execution.CapabilityValue testing = 4;</code>
     */
    public Builder setTesting(com.facebook.buck.remoteexecution.proto.CapabilityValue value) {
      if (testingBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        testing_ = value;
        onChanged();
      } else {
        testingBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     * <pre>
     * Canaried workers have a "testing" capability (with a random value). This
     * should be set when we want the request to go to a specific canaried worker.
     * </pre>
     *
     * <code>.facebook.remote_execution.CapabilityValue testing = 4;</code>
     */
    public Builder setTesting(
        com.facebook.buck.remoteexecution.proto.CapabilityValue.Builder builderForValue) {
      if (testingBuilder_ == null) {
        testing_ = builderForValue.build();
        onChanged();
      } else {
        testingBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     * <pre>
     * Canaried workers have a "testing" capability (with a random value). This
     * should be set when we want the request to go to a specific canaried worker.
     * </pre>
     *
     * <code>.facebook.remote_execution.CapabilityValue testing = 4;</code>
     */
    public Builder mergeTesting(com.facebook.buck.remoteexecution.proto.CapabilityValue value) {
      if (testingBuilder_ == null) {
        if (testing_ != null) {
          testing_ =
            com.facebook.buck.remoteexecution.proto.CapabilityValue.newBuilder(testing_).mergeFrom(value).buildPartial();
        } else {
          testing_ = value;
        }
        onChanged();
      } else {
        testingBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     * <pre>
     * Canaried workers have a "testing" capability (with a random value). This
     * should be set when we want the request to go to a specific canaried worker.
     * </pre>
     *
     * <code>.facebook.remote_execution.CapabilityValue testing = 4;</code>
     */
    public Builder clearTesting() {
      if (testingBuilder_ == null) {
        testing_ = null;
        onChanged();
      } else {
        testing_ = null;
        testingBuilder_ = null;
      }

      return this;
    }
    /**
     * <pre>
     * Canaried workers have a "testing" capability (with a random value). This
     * should be set when we want the request to go to a specific canaried worker.
     * </pre>
     *
     * <code>.facebook.remote_execution.CapabilityValue testing = 4;</code>
     */
    public com.facebook.buck.remoteexecution.proto.CapabilityValue.Builder getTestingBuilder() {
      
      onChanged();
      return getTestingFieldBuilder().getBuilder();
    }
    /**
     * <pre>
     * Canaried workers have a "testing" capability (with a random value). This
     * should be set when we want the request to go to a specific canaried worker.
     * </pre>
     *
     * <code>.facebook.remote_execution.CapabilityValue testing = 4;</code>
     */
    public com.facebook.buck.remoteexecution.proto.CapabilityValueOrBuilder getTestingOrBuilder() {
      if (testingBuilder_ != null) {
        return testingBuilder_.getMessageOrBuilder();
      } else {
        return testing_ == null ?
            com.facebook.buck.remoteexecution.proto.CapabilityValue.getDefaultInstance() : testing_;
      }
    }
    /**
     * <pre>
     * Canaried workers have a "testing" capability (with a random value). This
     * should be set when we want the request to go to a specific canaried worker.
     * </pre>
     *
     * <code>.facebook.remote_execution.CapabilityValue testing = 4;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        com.facebook.buck.remoteexecution.proto.CapabilityValue, com.facebook.buck.remoteexecution.proto.CapabilityValue.Builder, com.facebook.buck.remoteexecution.proto.CapabilityValueOrBuilder> 
        getTestingFieldBuilder() {
      if (testingBuilder_ == null) {
        testingBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            com.facebook.buck.remoteexecution.proto.CapabilityValue, com.facebook.buck.remoteexecution.proto.CapabilityValue.Builder, com.facebook.buck.remoteexecution.proto.CapabilityValueOrBuilder>(
                getTesting(),
                getParentForChildren(),
                isClean());
        testing_ = null;
      }
      return testingBuilder_;
    }

    private com.facebook.buck.remoteexecution.proto.CapabilityValue taskName_;
    private com.google.protobuf.SingleFieldBuilderV3<
        com.facebook.buck.remoteexecution.proto.CapabilityValue, com.facebook.buck.remoteexecution.proto.CapabilityValue.Builder, com.facebook.buck.remoteexecution.proto.CapabilityValueOrBuilder> taskNameBuilder_;
    /**
     * <code>.facebook.remote_execution.CapabilityValue task_name = 5;</code>
     */
    public boolean hasTaskName() {
      return taskNameBuilder_ != null || taskName_ != null;
    }
    /**
     * <code>.facebook.remote_execution.CapabilityValue task_name = 5;</code>
     */
    public com.facebook.buck.remoteexecution.proto.CapabilityValue getTaskName() {
      if (taskNameBuilder_ == null) {
        return taskName_ == null ? com.facebook.buck.remoteexecution.proto.CapabilityValue.getDefaultInstance() : taskName_;
      } else {
        return taskNameBuilder_.getMessage();
      }
    }
    /**
     * <code>.facebook.remote_execution.CapabilityValue task_name = 5;</code>
     */
    public Builder setTaskName(com.facebook.buck.remoteexecution.proto.CapabilityValue value) {
      if (taskNameBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        taskName_ = value;
        onChanged();
      } else {
        taskNameBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     * <code>.facebook.remote_execution.CapabilityValue task_name = 5;</code>
     */
    public Builder setTaskName(
        com.facebook.buck.remoteexecution.proto.CapabilityValue.Builder builderForValue) {
      if (taskNameBuilder_ == null) {
        taskName_ = builderForValue.build();
        onChanged();
      } else {
        taskNameBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     * <code>.facebook.remote_execution.CapabilityValue task_name = 5;</code>
     */
    public Builder mergeTaskName(com.facebook.buck.remoteexecution.proto.CapabilityValue value) {
      if (taskNameBuilder_ == null) {
        if (taskName_ != null) {
          taskName_ =
            com.facebook.buck.remoteexecution.proto.CapabilityValue.newBuilder(taskName_).mergeFrom(value).buildPartial();
        } else {
          taskName_ = value;
        }
        onChanged();
      } else {
        taskNameBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     * <code>.facebook.remote_execution.CapabilityValue task_name = 5;</code>
     */
    public Builder clearTaskName() {
      if (taskNameBuilder_ == null) {
        taskName_ = null;
        onChanged();
      } else {
        taskName_ = null;
        taskNameBuilder_ = null;
      }

      return this;
    }
    /**
     * <code>.facebook.remote_execution.CapabilityValue task_name = 5;</code>
     */
    public com.facebook.buck.remoteexecution.proto.CapabilityValue.Builder getTaskNameBuilder() {
      
      onChanged();
      return getTaskNameFieldBuilder().getBuilder();
    }
    /**
     * <code>.facebook.remote_execution.CapabilityValue task_name = 5;</code>
     */
    public com.facebook.buck.remoteexecution.proto.CapabilityValueOrBuilder getTaskNameOrBuilder() {
      if (taskNameBuilder_ != null) {
        return taskNameBuilder_.getMessageOrBuilder();
      } else {
        return taskName_ == null ?
            com.facebook.buck.remoteexecution.proto.CapabilityValue.getDefaultInstance() : taskName_;
      }
    }
    /**
     * <code>.facebook.remote_execution.CapabilityValue task_name = 5;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        com.facebook.buck.remoteexecution.proto.CapabilityValue, com.facebook.buck.remoteexecution.proto.CapabilityValue.Builder, com.facebook.buck.remoteexecution.proto.CapabilityValueOrBuilder> 
        getTaskNameFieldBuilder() {
      if (taskNameBuilder_ == null) {
        taskNameBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            com.facebook.buck.remoteexecution.proto.CapabilityValue, com.facebook.buck.remoteexecution.proto.CapabilityValue.Builder, com.facebook.buck.remoteexecution.proto.CapabilityValueOrBuilder>(
                getTaskName(),
                getParentForChildren(),
                isClean());
        taskName_ = null;
      }
      return taskNameBuilder_;
    }
    @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:facebook.remote_execution.WorkerRequirements)
  }

  // @@protoc_insertion_point(class_scope:facebook.remote_execution.WorkerRequirements)
  private static final com.facebook.buck.remoteexecution.proto.WorkerRequirements DEFAULT_INSTANCE;
  static {
    DEFAULT_INSTANCE = new com.facebook.buck.remoteexecution.proto.WorkerRequirements();
  }

  public static com.facebook.buck.remoteexecution.proto.WorkerRequirements getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

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

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

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

  @java.lang.Override
  public com.facebook.buck.remoteexecution.proto.WorkerRequirements getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }

}

