text:
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/container/v1beta1/cluster_service.proto

package com.google.container.v1beta1;

/**
 *
 *
 *

 * SetMasterAuthRequest updates the admin password of a cluster.
 *

 *
 * Protobuf type {@code google.container.v1beta1.SetMasterAuthRequest}
 */
public final class SetMasterAuthRequest extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.container.v1beta1.SetMasterAuthRequest)
    SetMasterAuthRequestOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use SetMasterAuthRequest.newBuilder() to construct.
  private SetMasterAuthRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private SetMasterAuthRequest() {
    projectId_ = "";
    zone_ = "";
    clusterId_ = "";
    action_ = 0;
    name_ = "";
  }

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

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
    return this.unknownFields;
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.container.v1beta1.ClusterServiceProto
        .internal_static_google_container_v1beta1_SetMasterAuthRequest_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.container.v1beta1.ClusterServiceProto
        .internal_static_google_container_v1beta1_SetMasterAuthRequest_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.container.v1beta1.SetMasterAuthRequest.class,
            com.google.container.v1beta1.SetMasterAuthRequest.Builder.class);
  }

  /**
   *
   *
   *

   * Operation type: what type update to perform.
   *

   *
   * Protobuf enum {@code google.container.v1beta1.SetMasterAuthRequest.Action}
   */
  public enum Action implements com.google.protobuf.ProtocolMessageEnum {
    /**
     *
     *
     *

     * Operation is unknown and will error out.
     *

     *
     * UNKNOWN = 0;
     */
    UNKNOWN(0),
    /**
     *
     *
     *

     * Set the password to a user generated value.
     *

     *
     * SET_PASSWORD = 1;
     */
    SET_PASSWORD(1),
    /**
     *
     *
     *

     * Generate a new password and set it to that.
     *

     *
     * GENERATE_PASSWORD = 2;
     */
    GENERATE_PASSWORD(2),
    /**
     *
     *
     *

     * Set the username.  If an empty username is provided, basic authentication
     * is disabled for the cluster.  If a non-empty username is provided, basic
     * authentication is enabled, with either a provided password or a generated
     * one.
     *

     *
     * SET_USERNAME = 3;
     */
    SET_USERNAME(3),
    UNRECOGNIZED(-1),
    ;

    /**
     *
     *
     *

     * Operation is unknown and will error out.
     *

     *
     * UNKNOWN = 0;
     */
    public static final int UNKNOWN_VALUE = 0;
    /**
     *
     *
     *

     * Set the password to a user generated value.
     *

     *
     * SET_PASSWORD = 1;
     */
    public static final int SET_PASSWORD_VALUE = 1;
    /**
     *
     *
     *

     * Generate a new password and set it to that.
     *

     *
     * GENERATE_PASSWORD = 2;
     */
    public static final int GENERATE_PASSWORD_VALUE = 2;
    /**
     *
     *
     *

     * Set the username.  If an empty username is provided, basic authentication
     * is disabled for the cluster.  If a non-empty username is provided, basic
     * authentication is enabled, with either a provided password or a generated
     * one.
     *

     *
     * SET_USERNAME = 3;
     */
    public static final int SET_USERNAME_VALUE = 3;

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

    /**
     * @param value The numeric wire value of the corresponding enum entry.
     * @return The enum associated with the given numeric wire value.
     * @deprecated Use {@link #forNumber(int)} instead.
     */
    @java.lang.Deprecated
    public static Action valueOf(int value) {
      return forNumber(value);
    }

    /**
     * @param value The numeric wire value of the corresponding enum entry.
     * @return The enum associated with the given numeric wire value.
     */
    public static Action forNumber(int value) {
      switch (value) {
        case 0:
          return UNKNOWN;
        case 1:
          return SET_PASSWORD;
        case 2:
          return GENERATE_PASSWORD;
        case 3:
          return SET_USERNAME;
        default:
          return null;
      }
    }

    public static com.google.protobuf.Internal.EnumLiteMap<Action> internalGetValueMap() {
      return internalValueMap;
    }

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

    public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() {
      if (this == UNRECOGNIZED) {
        throw new java.lang.IllegalStateException(
            "Can't get the descriptor of an unrecognized enum value.");
      }
      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.google.container.v1beta1.SetMasterAuthRequest.getDescriptor()
          .getEnumTypes()
          .get(0);
    }

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

    public static Action 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 Action(int value) {
      this.value = value;
    }

    // @@protoc_insertion_point(enum_scope:google.container.v1beta1.SetMasterAuthRequest.Action)
  }

  public static final int PROJECT_ID_FIELD_NUMBER = 1;
  private volatile java.lang.Object projectId_;
  /**
   *
   *
   *

   * Required. Deprecated. The Google Developers Console [project ID or project
   * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
   * This field has been deprecated and replaced by the name field.
   *

   *
   * string project_id = 1 [deprecated = true, (.google.api.field_behavior) = REQUIRED];
   *
   *
   * @deprecated google.container.v1beta1.SetMasterAuthRequest.project_id is deprecated. See
   *     google/container/v1beta1/cluster_service.proto;l=2829
   * @return The projectId.
   */
  @java.lang.Override
  @java.lang.Deprecated
  public java.lang.String getProjectId() {
    java.lang.Object ref = projectId_;
    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();
      projectId_ = s;
      return s;
    }
  }
  /**
   *
   *
   *

   * Required. Deprecated. The Google Developers Console [project ID or project
   * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
   * This field has been deprecated and replaced by the name field.
   *

   *
   * string project_id = 1 [deprecated = true, (.google.api.field_behavior) = REQUIRED];
   *
   *
   * @deprecated google.container.v1beta1.SetMasterAuthRequest.project_id is deprecated. See
   *     google/container/v1beta1/cluster_service.proto;l=2829
   * @return The bytes for projectId.
   */
  @java.lang.Override
  @java.lang.Deprecated
  public com.google.protobuf.ByteString getProjectIdBytes() {
    java.lang.Object ref = projectId_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      projectId_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int ZONE_FIELD_NUMBER = 2;
  private volatile java.lang.Object zone_;
  /**
   *
   *
   *

   * Required. Deprecated. The name of the Google Compute Engine
   * [zone](https://cloud.google.com/compute/docs/zones#available) in which the
   * cluster resides. This field has been deprecated and replaced by the name
   * field.
   *

   *
   * string zone = 2 [deprecated = true, (.google.api.field_behavior) = REQUIRED];
   *
   * @deprecated google.container.v1beta1.SetMasterAuthRequest.zone is deprecated. See
   *     google/container/v1beta1/cluster_service.proto;l=2838
   * @return The zone.
   */
  @java.lang.Override
  @java.lang.Deprecated
  public java.lang.String getZone() {
    java.lang.Object ref = zone_;
    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();
      zone_ = s;
      return s;
    }
  }
  /**
   *
   *
   *

   * Required. Deprecated. The name of the Google Compute Engine
   * [zone](https://cloud.google.com/compute/docs/zones#available) in which the
   * cluster resides. This field has been deprecated and replaced by the name
   * field.
   *

   *
   * string zone = 2 [deprecated = true, (.google.api.field_behavior) = REQUIRED];
   *
   * @deprecated google.container.v1beta1.SetMasterAuthRequest.zone is deprecated. See
   *     google/container/v1beta1/cluster_service.proto;l=2838
   * @return The bytes for zone.
   */
  @java.lang.Override
  @java.lang.Deprecated
  public com.google.protobuf.ByteString getZoneBytes() {
    java.lang.Object ref = zone_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      zone_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int CLUSTER_ID_FIELD_NUMBER = 3;
  private volatile java.lang.Object clusterId_;
  /**
   *
   *
   *

   * Required. Deprecated. The name of the cluster to upgrade.
   * This field has been deprecated and replaced by the name field.
   *

   *
   * string cluster_id = 3 [deprecated = true, (.google.api.field_behavior) = REQUIRED];
   *
   *
   * @deprecated google.container.v1beta1.SetMasterAuthRequest.cluster_id is deprecated. See
   *     google/container/v1beta1/cluster_service.proto;l=2845
   * @return The clusterId.
   */
  @java.lang.Override
  @java.lang.Deprecated
  public java.lang.String getClusterId() {
    java.lang.Object ref = clusterId_;
    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();
      clusterId_ = s;
      return s;
    }
  }
  /**
   *
   *
   *

   * Required. Deprecated. The name of the cluster to upgrade.
   * This field has been deprecated and replaced by the name field.
   *

   *
   * string cluster_id = 3 [deprecated = true, (.google.api.field_behavior) = REQUIRED];
   *
   *
   * @deprecated google.container.v1beta1.SetMasterAuthRequest.cluster_id is deprecated. See
   *     google/container/v1beta1/cluster_service.proto;l=2845
   * @return The bytes for clusterId.
   */
  @java.lang.Override
  @java.lang.Deprecated
  public com.google.protobuf.ByteString getClusterIdBytes() {
    java.lang.Object ref = clusterId_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      clusterId_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int ACTION_FIELD_NUMBER = 4;
  private int action_;
  /**
   *
   *
   *

   * Required. The exact form of action to be taken on the master auth.
   *

   *
   *
   * .google.container.v1beta1.SetMasterAuthRequest.Action action = 4 [(.google.api.field_behavior) = REQUIRED];
   *
   *
   * @return The enum numeric value on the wire for action.
   */
  @java.lang.Override
  public int getActionValue() {
    return action_;
  }
  /**
   *
   *
   *

   * Required. The exact form of action to be taken on the master auth.
   *

   *
   *
   * .google.container.v1beta1.SetMasterAuthRequest.Action action = 4 [(.google.api.field_behavior) = REQUIRED];
   *
   *
   * @return The action.
   */
  @java.lang.Override
  public com.google.container.v1beta1.SetMasterAuthRequest.Action getAction() {
    @SuppressWarnings("deprecation")
    com.google.container.v1beta1.SetMasterAuthRequest.Action result =
        com.google.container.v1beta1.SetMasterAuthRequest.Action.valueOf(action_);
    return result == null
        ? com.google.container.v1beta1.SetMasterAuthRequest.Action.UNRECOGNIZED
        : result;
  }

  public static final int UPDATE_FIELD_NUMBER = 5;
  private com.google.container.v1beta1.MasterAuth update_;
  /**
   *
   *
   *

   * Required. A description of the update.
   *

   *
   *
   * .google.container.v1beta1.MasterAuth update = 5 [(.google.api.field_behavior) = REQUIRED];
   *
   *
   * @return Whether the update field is set.
   */
  @java.lang.Override
  public boolean hasUpdate() {
    return update_ != null;
  }
  /**
   *
   *
   *

   * Required. A description of the update.
   *

   *
   *
   * .google.container.v1beta1.MasterAuth update = 5 [(.google.api.field_behavior) = REQUIRED];
   *
   *
   * @return The update.
   */
  @java.lang.Override
  public com.google.container.v1beta1.MasterAuth getUpdate() {
    return update_ == null ? com.google.container.v1beta1.MasterAuth.getDefaultInstance() : update_;
  }
  /**
   *
   *
   *

   * Required. A description of the update.
   *

   *
   *
   * .google.container.v1beta1.MasterAuth update = 5 [(.google.api.field_behavior) = REQUIRED];
   *
   */
  @java.lang.Override
  public com.google.container.v1beta1.MasterAuthOrBuilder getUpdateOrBuilder() {
    return getUpdate();
  }

  public static final int NAME_FIELD_NUMBER = 7;
  private volatile java.lang.Object name_;
  /**
   *
   *
   *

   * The name (project, location, cluster) of the cluster to set auth.
   * Specified in the format `projects/*/locations/*/clusters/*`.
   *

   *
   * string name = 7;
   *
   * @return The name.
   */
  @java.lang.Override
  public java.lang.String getName() {
    java.lang.Object ref = name_;
    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();
      name_ = s;
      return s;
    }
  }
  /**
   *
   *
   *

   * The name (project, location, cluster) of the cluster to set auth.
   * Specified in the format `projects/*/locations/*/clusters/*`.
   *

   *
   * string name = 7;
   *
   * @return The bytes for name.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getNameBytes() {
    java.lang.Object ref = name_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      name_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(projectId_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, projectId_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(zone_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, zone_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clusterId_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 3, clusterId_);
    }
    if (action_ != com.google.container.v1beta1.SetMasterAuthRequest.Action.UNKNOWN.getNumber()) {
      output.writeEnum(4, action_);
    }
    if (update_ != null) {
      output.writeMessage(5, getUpdate());
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 7, name_);
    }
    getUnknownFields().writeTo(output);
  }

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

    size = 0;
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(projectId_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, projectId_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(zone_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, zone_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clusterId_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, clusterId_);
    }
    if (action_ != com.google.container.v1beta1.SetMasterAuthRequest.Action.UNKNOWN.getNumber()) {
      size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, action_);
    }
    if (update_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getUpdate());
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, name_);
    }
    size += getUnknownFields().getSerializedSize();
    memoizedSize = size;
    return size;
  }

  @java.lang.Override
  public boolean equals(final java.lang.Object obj) {
    if (obj == this) {
      return true;
    }
    if (!(obj instanceof com.google.container.v1beta1.SetMasterAuthRequest)) {
      return super.equals(obj);
    }
    com.google.container.v1beta1.SetMasterAuthRequest other =
        (com.google.container.v1beta1.SetMasterAuthRequest) obj;

    if (!getProjectId().equals(other.getProjectId())) return false;
    if (!getZone().equals(other.getZone())) return false;
    if (!getClusterId().equals(other.getClusterId())) return false;
    if (action_ != other.action_) return false;
    if (hasUpdate() != other.hasUpdate()) return false;
    if (hasUpdate()) {
      if (!getUpdate().equals(other.getUpdate())) return false;
    }
    if (!getName().equals(other.getName())) return false;
    if (!getUnknownFields().equals(other.getUnknownFields())) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    hash = (37 * hash) + PROJECT_ID_FIELD_NUMBER;
    hash = (53 * hash) + getProjectId().hashCode();
    hash = (37 * hash) + ZONE_FIELD_NUMBER;
    hash = (53 * hash) + getZone().hashCode();
    hash = (37 * hash) + CLUSTER_ID_FIELD_NUMBER;
    hash = (53 * hash) + getClusterId().hashCode();
    hash = (37 * hash) + ACTION_FIELD_NUMBER;
    hash = (53 * hash) + action_;
    if (hasUpdate()) {
      hash = (37 * hash) + UPDATE_FIELD_NUMBER;
      hash = (53 * hash) + getUpdate().hashCode();
    }
    hash = (37 * hash) + NAME_FIELD_NUMBER;
    hash = (53 * hash) + getName().hashCode();
    hash = (29 * hash) + getUnknownFields().hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.container.v1beta1.SetMasterAuthRequest parseFrom(
      java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.container.v1beta1.SetMasterAuthRequest parseFrom(
      java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.container.v1beta1.SetMasterAuthRequest parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.container.v1beta1.SetMasterAuthRequest parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.container.v1beta1.SetMasterAuthRequest parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.container.v1beta1.SetMasterAuthRequest parseFrom(
      byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.container.v1beta1.SetMasterAuthRequest parseFrom(
      java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.container.v1beta1.SetMasterAuthRequest 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.google.container.v1beta1.SetMasterAuthRequest parseDelimitedFrom(
      java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
  }

  public static com.google.container.v1beta1.SetMasterAuthRequest 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.google.container.v1beta1.SetMasterAuthRequest parseFrom(
      com.google.protobuf.CodedInputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.container.v1beta1.SetMasterAuthRequest 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.google.container.v1beta1.SetMasterAuthRequest 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;
  }
  /**
   *
   *
   *

   * SetMasterAuthRequest updates the admin password of a cluster.
   *

   *
   * Protobuf type {@code google.container.v1beta1.SetMasterAuthRequest}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.container.v1beta1.SetMasterAuthRequest)
      com.google.container.v1beta1.SetMasterAuthRequestOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.container.v1beta1.ClusterServiceProto
          .internal_static_google_container_v1beta1_SetMasterAuthRequest_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.container.v1beta1.ClusterServiceProto
          .internal_static_google_container_v1beta1_SetMasterAuthRequest_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.container.v1beta1.SetMasterAuthRequest.class,
              com.google.container.v1beta1.SetMasterAuthRequest.Builder.class);
    }

    // Construct using com.google.container.v1beta1.SetMasterAuthRequest.newBuilder()
    private Builder() {}

    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
    }

    @java.lang.Override
    public Builder clear() {
      super.clear();
      projectId_ = "";

      zone_ = "";

      clusterId_ = "";

      action_ = 0;

      if (updateBuilder_ == null) {
        update_ = null;
      } else {
        update_ = null;
        updateBuilder_ = null;
      }
      name_ = "";

      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.container.v1beta1.ClusterServiceProto
          .internal_static_google_container_v1beta1_SetMasterAuthRequest_descriptor;
    }

    @java.lang.Override
    public com.google.container.v1beta1.SetMasterAuthRequest getDefaultInstanceForType() {
      return com.google.container.v1beta1.SetMasterAuthRequest.getDefaultInstance();
    }

    @java.lang.Override
    public com.google.container.v1beta1.SetMasterAuthRequest build() {
      com.google.container.v1beta1.SetMasterAuthRequest result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public com.google.container.v1beta1.SetMasterAuthRequest buildPartial() {
      com.google.container.v1beta1.SetMasterAuthRequest result =
          new com.google.container.v1beta1.SetMasterAuthRequest(this);
      result.projectId_ = projectId_;
      result.zone_ = zone_;
      result.clusterId_ = clusterId_;
      result.action_ = action_;
      if (updateBuilder_ == null) {
        result.update_ = update_;
      } else {
        result.update_ = updateBuilder_.build();
      }
      result.name_ = name_;
      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.google.container.v1beta1.SetMasterAuthRequest) {
        return mergeFrom((com.google.container.v1beta1.SetMasterAuthRequest) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.container.v1beta1.SetMasterAuthRequest other) {
      if (other == com.google.container.v1beta1.SetMasterAuthRequest.getDefaultInstance())
        return this;
      if (!other.getProjectId().isEmpty()) {
        projectId_ = other.projectId_;
        onChanged();
      }
      if (!other.getZone().isEmpty()) {
        zone_ = other.zone_;
        onChanged();
      }
      if (!other.getClusterId().isEmpty()) {
        clusterId_ = other.clusterId_;
        onChanged();
      }
      if (other.action_ != 0) {
        setActionValue(other.getActionValue());
      }
      if (other.hasUpdate()) {
        mergeUpdate(other.getUpdate());
      }
      if (!other.getName().isEmpty()) {
        name_ = other.name_;
        onChanged();
      }
      this.mergeUnknownFields(other.getUnknownFields());
      onChanged();
      return this;
    }

    @java.lang.Override
    public final boolean isInitialized() {
      return true;
    }

    @java.lang.Override
    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      if (extensionRegistry == null) {
        throw new java.lang.NullPointerException();
      }
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            case 10:
              {
                projectId_ = input.readStringRequireUtf8();

                break;
              } // case 10
            case 18:
              {
                zone_ = input.readStringRequireUtf8();

                break;
              } // case 18
            case 26:
              {
                clusterId_ = input.readStringRequireUtf8();

                break;
              } // case 26
            case 32:
              {
                action_ = input.readEnum();

                break;
              } // case 32
            case 42:
              {
                input.readMessage(getUpdateFieldBuilder().getBuilder(), extensionRegistry);

                break;
              } // case 42
            case 58:
              {
                name_ = input.readStringRequireUtf8();

                break;
              } // case 58
            default:
              {
                if (!super.parseUnknownField(input, extensionRegistry, tag)) {
                  done = true; // was an endgroup tag
                }
                break;
              } // default:
          } // switch (tag)
        } // while (!done)
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.unwrapIOException();
      } finally {
        onChanged();
      } // finally
      return this;
    }

    private java.lang.Object projectId_ = "";
    /**
     *
     *
     *

     * Required. Deprecated. The Google Developers Console [project ID or project
     * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
     * This field has been deprecated and replaced by the name field.
     *

     *
     * string project_id = 1 [deprecated = true, (.google.api.field_behavior) = REQUIRED];
     *
     *
     * @deprecated google.container.v1beta1.SetMasterAuthRequest.project_id is deprecated. See
     *     google/container/v1beta1/cluster_service.proto;l=2829
     * @return The projectId.
     */
    @java.lang.Deprecated
    public java.lang.String getProjectId() {
      java.lang.Object ref = projectId_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        projectId_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     *

     * Required. Deprecated. The Google Developers Console [project ID or project
     * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
     * This field has been deprecated and replaced by the name field.
     *

     *
     * string project_id = 1 [deprecated = true, (.google.api.field_behavior) = REQUIRED];
     *
     *
     * @deprecated google.container.v1beta1.SetMasterAuthRequest.project_id is deprecated. See
     *     google/container/v1beta1/cluster_service.proto;l=2829
     * @return The bytes for projectId.
     */
    @java.lang.Deprecated
    public com.google.protobuf.ByteString getProjectIdBytes() {
      java.lang.Object ref = projectId_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        projectId_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     *

     * Required. Deprecated. The Google Developers Console [project ID or project
     * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
     * This field has been deprecated and replaced by the name field.
     *

     *
     * string project_id = 1 [deprecated = true, (.google.api.field_behavior) = REQUIRED];
     *
     *
     * @deprecated google.container.v1beta1.SetMasterAuthRequest.project_id is deprecated. See
     *     google/container/v1beta1/cluster_service.proto;l=2829
     * @param value The projectId to set.
     * @return This builder for chaining.
     */
    @java.lang.Deprecated
    public Builder setProjectId(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      projectId_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     *

     * Required. Deprecated. The Google Developers Console [project ID or project
     * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
     * This field has been deprecated and replaced by the name field.
     *

     *
     * string project_id = 1 [deprecated = true, (.google.api.field_behavior) = REQUIRED];
     *
     *
     * @deprecated google.container.v1beta1.SetMasterAuthRequest.project_id is deprecated. See
     *     google/container/v1beta1/cluster_service.proto;l=2829
     * @return This builder for chaining.
     */
    @java.lang.Deprecated
    public Builder clearProjectId() {

      projectId_ = getDefaultInstance().getProjectId();
      onChanged();
      return this;
    }
    /**
     *
     *
     *

     * Required. Deprecated. The Google Developers Console [project ID or project
     * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
     * This field has been deprecated and replaced by the name field.
     *

     *
     * string project_id = 1 [deprecated = true, (.google.api.field_behavior) = REQUIRED];
     *
     *
     * @deprecated google.container.v1beta1.SetMasterAuthRequest.project_id is deprecated. See
     *     google/container/v1beta1/cluster_service.proto;l=2829
     * @param value The bytes for projectId to set.
     * @return This builder for chaining.
     */
    @java.lang.Deprecated
    public Builder setProjectIdBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

      projectId_ = value;
      onChanged();
      return this;
    }

    private java.lang.Object zone_ = "";
    /**
     *
     *
     *

     * Required. Deprecated. The name of the Google Compute Engine
     * [zone](https://cloud.google.com/compute/docs/zones#available) in which the
     * cluster resides. This field has been deprecated and replaced by the name
     * field.
     *

     *
     * string zone = 2 [deprecated = true, (.google.api.field_behavior) = REQUIRED];
     *
     * @deprecated google.container.v1beta1.SetMasterAuthRequest.zone is deprecated. See
     *     google/container/v1beta1/cluster_service.proto;l=2838
     * @return The zone.
     */
    @java.lang.Deprecated
    public java.lang.String getZone() {
      java.lang.Object ref = zone_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        zone_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     *

     * Required. Deprecated. The name of the Google Compute Engine
     * [zone](https://cloud.google.com/compute/docs/zones#available) in which the
     * cluster resides. This field has been deprecated and replaced by the name
     * field.
     *

     *
     * string zone = 2 [deprecated = true, (.google.api.field_behavior) = REQUIRED];
     *
     * @deprecated google.container.v1beta1.SetMasterAuthRequest.zone is deprecated. See
     *     google/container/v1beta1/cluster_service.proto;l=2838
     * @return The bytes for zone.
     */
    @java.lang.Deprecated
    public com.google.protobuf.ByteString getZoneBytes() {
      java.lang.Object ref = zone_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        zone_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     *

     * Required. Deprecated. The name of the Google Compute Engine
     * [zone](https://cloud.google.com/compute/docs/zones#available) in which the
     * cluster resides. This field has been deprecated and replaced by the name
     * field.
     *

     *
     * string zone = 2 [deprecated = true, (.google.api.field_behavior) = REQUIRED];
     *
     * @deprecated google.container.v1beta1.SetMasterAuthRequest.zone is deprecated. See
     *     google/container/v1beta1/cluster_service.proto;l=2838
     * @param value The zone to set.
     * @return This builder for chaining.
     */
    @java.lang.Deprecated
    public Builder setZone(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      zone_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     *

     * Required. Deprecated. The name of the Google Compute Engine
     * [zone](https://cloud.google.com/compute/docs/zones#available) in which the
     * cluster resides. This field has been deprecated and replaced by the name
     * field.
     *

     *
     * string zone = 2 [deprecated = true, (.google.api.field_behavior) = REQUIRED];
     *
     * @deprecated google.container.v1beta1.SetMasterAuthRequest.zone is deprecated. See
     *     google/container/v1beta1/cluster_service.proto;l=2838
     * @return This builder for chaining.
     */
    @java.lang.Deprecated
    public Builder clearZone() {

      zone_ = getDefaultInstance().getZone();
      onChanged();
      return this;
    }
    /**
     *
     *
     *

     * Required. Deprecated. The name of the Google Compute Engine
     * [zone](https://cloud.google.com/compute/docs/zones#available) in which the
     * cluster resides. This field has been deprecated and replaced by the name
     * field.
     *

     *
     * string zone = 2 [deprecated = true, (.google.api.field_behavior) = REQUIRED];
     *
     * @deprecated google.container.v1beta1.SetMasterAuthRequest.zone is deprecated. See
     *     google/container/v1beta1/cluster_service.proto;l=2838
     * @param value The bytes for zone to set.
     * @return This builder for chaining.
     */
    @java.lang.Deprecated
    public Builder setZoneBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

      zone_ = value;
      onChanged();
      return this;
    }

    private java.lang.Object clusterId_ = "";
    /**
     *
     *
     *

     * Required. Deprecated. The name of the cluster to upgrade.
     * This field has been deprecated and replaced by the name field.
     *

     *
     * string cluster_id = 3 [deprecated = true, (.google.api.field_behavior) = REQUIRED];
     *
     *
     * @deprecated google.container.v1beta1.SetMasterAuthRequest.cluster_id is deprecated. See
     *     google/container/v1beta1/cluster_service.proto;l=2845
     * @return The clusterId.
     */
    @java.lang.Deprecated
    public java.lang.String getClusterId() {
      java.lang.Object ref = clusterId_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        clusterId_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     *

     * Required. Deprecated. The name of the cluster to upgrade.
     * This field has been deprecated and replaced by the name field.
     *

     *
     * string cluster_id = 3 [deprecated = true, (.google.api.field_behavior) = REQUIRED];
     *
     *
     * @deprecated google.container.v1beta1.SetMasterAuthRequest.cluster_id is deprecated. See
     *     google/container/v1beta1/cluster_service.proto;l=2845
     * @return The bytes for clusterId.
     */
    @java.lang.Deprecated
    public com.google.protobuf.ByteString getClusterIdBytes() {
      java.lang.Object ref = clusterId_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        clusterId_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     *

     * Required. Deprecated. The name of the cluster to upgrade.
     * This field has been deprecated and replaced by the name field.
     *

     *
     * string cluster_id = 3 [deprecated = true, (.google.api.field_behavior) = REQUIRED];
     *
     *
     * @deprecated google.container.v1beta1.SetMasterAuthRequest.cluster_id is deprecated. See
     *     google/container/v1beta1/cluster_service.proto;l=2845
     * @param value The clusterId to set.
     * @return This builder for chaining.
     */
    @java.lang.Deprecated
    public Builder setClusterId(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      clusterId_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     *

     * Required. Deprecated. The name of the cluster to upgrade.
     * This field has been deprecated and replaced by the name field.
     *

     *
     * string cluster_id = 3 [deprecated = true, (.google.api.field_behavior) = REQUIRED];
     *
     *
     * @deprecated google.container.v1beta1.SetMasterAuthRequest.cluster_id is deprecated. See
     *     google/container/v1beta1/cluster_service.proto;l=2845
     * @return This builder for chaining.
     */
    @java.lang.Deprecated
    public Builder clearClusterId() {

      clusterId_ = getDefaultInstance().getClusterId();
      onChanged();
      return this;
    }
    /**
     *
     *
     *

     * Required. Deprecated. The name of the cluster to upgrade.
     * This field has been deprecated and replaced by the name field.
     *

     *
     * string cluster_id = 3 [deprecated = true, (.google.api.field_behavior) = REQUIRED];
     *
     *
     * @deprecated google.container.v1beta1.SetMasterAuthRequest.cluster_id is deprecated. See
     *     google/container/v1beta1/cluster_service.proto;l=2845
     * @param value The bytes for clusterId to set.
     * @return This builder for chaining.
     */
    @java.lang.Deprecated
    public Builder setClusterIdBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

      clusterId_ = value;
      onChanged();
      return this;
    }

    private int action_ = 0;
    /**
     *
     *
     *

     * Required. The exact form of action to be taken on the master auth.
     *

     *
     *
     * .google.container.v1beta1.SetMasterAuthRequest.Action action = 4 [(.google.api.field_behavior) = REQUIRED];
     *
     *
     * @return The enum numeric value on the wire for action.
     */
    @java.lang.Override
    public int getActionValue() {
      return action_;
    }
    /**
     *
     *
     *

     * Required. The exact form of action to be taken on the master auth.
     *

     *
     *
     * .google.container.v1beta1.SetMasterAuthRequest.Action action = 4 [(.google.api.field_behavior) = REQUIRED];
     *
     *
     * @param value The enum numeric value on the wire for action to set.
     * @return This builder for chaining.
     */
    public Builder setActionValue(int value) {

      action_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     *

     * Required. The exact form of action to be taken on the master auth.
     *

     *
     *
     * .google.container.v1beta1.SetMasterAuthRequest.Action action = 4 [(.google.api.field_behavior) = REQUIRED];
     *
     *
     * @return The action.
     */
    @java.lang.Override
    public com.google.container.v1beta1.SetMasterAuthRequest.Action getAction() {
      @SuppressWarnings("deprecation")
      com.google.container.v1beta1.SetMasterAuthRequest.Action result =
          com.google.container.v1beta1.SetMasterAuthRequest.Action.valueOf(action_);
      return result == null
          ? com.google.container.v1beta1.SetMasterAuthRequest.Action.UNRECOGNIZED
          : result;
    }
    /**
     *
     *
     *

     * Required. The exact form of action to be taken on the master auth.
     *

     *
     *
     * .google.container.v1beta1.SetMasterAuthRequest.Action action = 4 [(.google.api.field_behavior) = REQUIRED];
     *
     *
     * @param value The action to set.
     * @return This builder for chaining.
     */
    public Builder setAction(com.google.container.v1beta1.SetMasterAuthRequest.Action value) {
      if (value == null) {
        throw new NullPointerException();
      }

      action_ = value.getNumber();
      onChanged();
      return this;
    }
    /**
     *
     *
     *

     * Required. The exact form of action to be taken on the master auth.
     *

     *
     *
     * .google.container.v1beta1.SetMasterAuthRequest.Action action = 4 [(.google.api.field_behavior) = REQUIRED];
     *
     *
     * @return This builder for chaining.
     */
    public Builder clearAction() {

      action_ = 0;
      onChanged();
      return this;
    }

    private com.google.container.v1beta1.MasterAuth update_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.container.v1beta1.MasterAuth,
            com.google.container.v1beta1.MasterAuth.Builder,
            com.google.container.v1beta1.MasterAuthOrBuilder>
        updateBuilder_;
    /**
     *
     *
     *

     * Required. A description of the update.
     *

     *
     *
     * .google.container.v1beta1.MasterAuth update = 5 [(.google.api.field_behavior) = REQUIRED];
     *
     *
     * @return Whether the update field is set.
     */
    public boolean hasUpdate() {
      return updateBuilder_ != null || update_ != null;
    }
    /**
     *
     *
     *

     * Required. A description of the update.
     *

     *
     *
     * .google.container.v1beta1.MasterAuth update = 5 [(.google.api.field_behavior) = REQUIRED];
     *
     *
     * @return The update.
     */
    public com.google.container.v1beta1.MasterAuth getUpdate() {
      if (updateBuilder_ == null) {
        return update_ == null
            ? com.google.container.v1beta1.MasterAuth.getDefaultInstance()
            : update_;
      } else {
        return updateBuilder_.getMessage();
      }
    }
    /**
     *
     *
     *

     * Required. A description of the update.
     *

     *
     *
     * .google.container.v1beta1.MasterAuth update = 5 [(.google.api.field_behavior) = REQUIRED];
     *
     */
    public Builder setUpdate(com.google.container.v1beta1.MasterAuth value) {
      if (updateBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        update_ = value;
        onChanged();
      } else {
        updateBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *
     *
     *

     * Required. A description of the update.
     *

     *
     *
     * .google.container.v1beta1.MasterAuth update = 5 [(.google.api.field_behavior) = REQUIRED];
     *
     */
    public Builder setUpdate(com.google.container.v1beta1.MasterAuth.Builder builderForValue) {
      if (updateBuilder_ == null) {
        update_ = builderForValue.build();
        onChanged();
      } else {
        updateBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     *

     * Required. A description of the update.
     *

     *
     *
     * .google.container.v1beta1.MasterAuth update = 5 [(.google.api.field_behavior) = REQUIRED];
     *
     */
    public Builder mergeUpdate(com.google.container.v1beta1.MasterAuth value) {
      if (updateBuilder_ == null) {
        if (update_ != null) {
          update_ =
              com.google.container.v1beta1.MasterAuth.newBuilder(update_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          update_ = value;
        }
        onChanged();
      } else {
        updateBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *
     *
     *

     * Required. A description of the update.
     *

     *
     *
     * .google.container.v1beta1.MasterAuth update = 5 [(.google.api.field_behavior) = REQUIRED];
     *
     */
    public Builder clearUpdate() {
      if (updateBuilder_ == null) {
        update_ = null;
        onChanged();
      } else {
        update_ = null;
        updateBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     *

     * Required. A description of the update.
     *

     *
     *
     * .google.container.v1beta1.MasterAuth update = 5 [(.google.api.field_behavior) = REQUIRED];
     *
     */
    public com.google.container.v1beta1.MasterAuth.Builder getUpdateBuilder() {

      onChanged();
      return getUpdateFieldBuilder().getBuilder();
    }
    /**
     *
     *
     *

     * Required. A description of the update.
     *

     *
     *
     * .google.container.v1beta1.MasterAuth update = 5 [(.google.api.field_behavior) = REQUIRED];
     *
     */
    public com.google.container.v1beta1.MasterAuthOrBuilder getUpdateOrBuilder() {
      if (updateBuilder_ != null) {
        return updateBuilder_.getMessageOrBuilder();
      } else {
        return update_ == null
            ? com.google.container.v1beta1.MasterAuth.getDefaultInstance()
            : update_;
      }
    }
    /**
     *
     *
     *

     * Required. A description of the update.
     *

     *
     *
     * .google.container.v1beta1.MasterAuth update = 5 [(.google.api.field_behavior) = REQUIRED];
     *
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.container.v1beta1.MasterAuth,
            com.google.container.v1beta1.MasterAuth.Builder,
            com.google.container.v1beta1.MasterAuthOrBuilder>
        getUpdateFieldBuilder() {
      if (updateBuilder_ == null) {
        updateBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.container.v1beta1.MasterAuth,
                com.google.container.v1beta1.MasterAuth.Builder,
                com.google.container.v1beta1.MasterAuthOrBuilder>(
                getUpdate(), getParentForChildren(), isClean());
        update_ = null;
      }
      return updateBuilder_;
    }

    private java.lang.Object name_ = "";
    /**
     *
     *
     *

     * The name (project, location, cluster) of the cluster to set auth.
     * Specified in the format `projects/*/locations/*/clusters/*`.
     *

     *
     * string name = 7;
     *
     * @return The name.
     */
    public java.lang.String getName() {
      java.lang.Object ref = name_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        name_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     *

     * The name (project, location, cluster) of the cluster to set auth.
     * Specified in the format `projects/*/locations/*/clusters/*`.
     *

     *
     * string name = 7;
     *
     * @return The bytes for name.
     */
    public com.google.protobuf.ByteString getNameBytes() {
      java.lang.Object ref = name_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        name_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     *

     * The name (project, location, cluster) of the cluster to set auth.
     * Specified in the format `projects/*/locations/*/clusters/*`.
     *

     *
     * string name = 7;
     *
     * @param value The name to set.
     * @return This builder for chaining.
     */
    public Builder setName(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      name_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     *

     * The name (project, location, cluster) of the cluster to set auth.
     * Specified in the format `projects/*/locations/*/clusters/*`.
     *

     *
     * string name = 7;
     *
     * @return This builder for chaining.
     */
    public Builder clearName() {

      name_ = getDefaultInstance().getName();
      onChanged();
      return this;
    }
    /**
     *
     *
     *

     * The name (project, location, cluster) of the cluster to set auth.
     * Specified in the format `projects/*/locations/*/clusters/*`.
     *

     *
     * string name = 7;
     *
     * @param value The bytes for name to set.
     * @return This builder for chaining.
     */
    public Builder setNameBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

      name_ = 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:google.container.v1beta1.SetMasterAuthRequest)
  }

  // @@protoc_insertion_point(class_scope:google.container.v1beta1.SetMasterAuthRequest)
  private static final com.google.container.v1beta1.SetMasterAuthRequest DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.container.v1beta1.SetMasterAuthRequest();
  }

  public static com.google.container.v1beta1.SetMasterAuthRequest getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<SetMasterAuthRequest> PARSER =
      new com.google.protobuf.AbstractParser<SetMasterAuthRequest>() {
        @java.lang.Override
        public SetMasterAuthRequest parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          Builder builder = newBuilder();
          try {
            builder.mergeFrom(input, extensionRegistry);
          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
            throw e.setUnfinishedMessage(builder.buildPartial());
          } catch (com.google.protobuf.UninitializedMessageException e) {
            throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
          } catch (java.io.IOException e) {
            throw new com.google.protobuf.InvalidProtocolBufferException(e)
                .setUnfinishedMessage(builder.buildPartial());
          }
          return builder.buildPartial();
        }
      };

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

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

  @java.lang.Override
  public com.google.container.v1beta1.SetMasterAuthRequest getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
}


text:
namespace circa {

// Returns a common type, which is guaranteed to hold all the types in this
// list. Currently, this is not very sophisticated.
Type* find_common_type(Value* list);

// Shorthands for finding the common type of a fixed list.
Type* find_common_type(Type* type1, Type* type2);
Type* find_common_type(Type* type1, Type* type2, Type* type3);

Type* infer_type_of_get_index(Term* input);

// Create a List-based type that will have N elements, all of the same type.
Type* create_typed_unsized_list_type(Type* elementType);

} // namespace circa

redpajama_set_name: RedPajamaGithub


text:
package com.leaf.gankio.ui.mine.setting;

import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.net.Uri;
import android.view.MenuItem;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;

import com.jakewharton.rxbinding.view.RxView;
import com.leaf.gankio.BuildConfig;
import com.leaf.gankio.R;
import com.leaf.gankio.ui.base.BaseActivity;
import com.leaf.gankio.ui.base.GankIoApp;
import com.leaf.gankio.utils.ActionBarUtil;
import com.leaf.gankio.utils.Constants;
import com.leaf.gankio.utils.FileUtil;
import com.leaf.gankio.utils.GlideBuilderTool;
import com.leaf.gankio.utils.ShareUtil;
import com.leaf.gankio.utils.SnackbarUtil;

import java.io.File;
import java.util.List;
import java.util.concurrent.TimeUnit;

import butterknife.Bind;
import rx.android.schedulers.AndroidSchedulers;
import rx.functions.Action1;
import rx.functions.Func1;
import rx.schedulers.Schedulers;

/**
 * @author :  Leaf<br>
 * @date : 2016/6/19 17:39
 * @TODO : 设置
 */

public class MineSetting extends BaseActivity {

    @Bind(R.id.setting_version_text)
    TextView settingVersionText;
    @Bind(R.id.setting_cache_text)
    TextView settingCacheText;
    @Bind(R.id.setting_version_lay)
    RelativeLayout settingVersionLay;
    @Bind(R.id.setting_cache_lay)
    RelativeLayout settingCacheLay;
    @Bind(R.id.setting_suggestions_lay)
    RelativeLayout settingSuggestionsLay;
    @Bind(R.id.setting_score_lay)
    RelativeLayout settingScoreLay;
    @Bind(R.id.setting_share_lay)
    RelativeLayout settingShareLay;
    @Bind(R.id.setting_aboutme_lay)
    RelativeLayout settingAboutmeLay;
    @Bind(R.id.setting_logout_lay)
    RelativeLayout settingLogoutLay;

    @Override
    protected int setLayoutResource() {
        return R.layout.activity_setting;
    }

    @Override
    protected void initActionBar() {
        ActionBarUtil.initLeftBackActionBar(R.string.action_settings, this);
    }

    @Override
    protected void initView() {

        long cacheSize = FileUtil.getFolderSize(GankIoApp.getInstance().getExternalCacheDir()) ;
        long meizhiSize = FileUtil.getFolderSize(new File(Constants.OwnCacheDirectory + "Cache")) ;

        settingVersionText.setText("V " + BuildConfig.VERSION_NAME);
        settingCacheText.setText((cacheSize /*+ meizhiSize*/) > 1024 ? FileUtil.getFormatFolderSize(cacheSize /*+ meizhiSize*/):"");

        RxView.clicks(settingCacheLay).throttleFirst(500, TimeUnit.MILLISECONDS)
                .observeOn(Schedulers.io())
                .map(new Func1<Void, Boolean>() {
                    @Override
                    public Boolean call(Void aVoid) {
                        if (!"".equals(settingCacheText.getText().toString())) {
                            GlideBuilderTool.getInstance().clearMemory(mContext);
                            GlideBuilderTool.getInstance().clearDiskCache(mContext);
                            FileUtil.deleteFolderFile(new File(Constants.OwnCacheDirectory + "Cache"));
                            FileUtil.deleteFolderFile(GankIoApp.getInstance().getExternalCacheDir());
                            return true;
                        }
                        return true;
                    }
                }).observeOn(AndroidSchedulers.mainThread())
                .subscribe(new Action1<Boolean>() {
                    @Override
                    public void call(Boolean b) {
                        if (b) {
                            SnackbarUtil.showSnackBar(getWindow().getDecorView(), getString(R.string.clear_cache_tips));
                        }
                        settingCacheText.setText("");

                    }
                });

        RxView.clicks(settingSuggestionsLay).throttleFirst(500, TimeUnit.MILLISECONDS)
                .subscribe(new Action1<Void>() {
                    @Override
                    public void call(Void aVoid) {
                        doSuggest();
                    }
                });

        RxView.clicks(settingScoreLay).throttleFirst(500, TimeUnit.MILLISECONDS)
                .subscribe(new Action1<Void>() {
                    @Override
                    public void call(Void aVoid) {
                        doSocre();
                    }
                });

        RxView.clicks(settingShareLay).throttleFirst(500, TimeUnit.MILLISECONDS)
                .subscribe(new Action1<Void>() {
                    @Override
                    public void call(Void aVoid) {
                        ShareUtil.share(mContext, getString(R.string.share_text));
                    }
                });

        RxView.clicks(settingAboutmeLay).throttleFirst(500, TimeUnit.MILLISECONDS)
                .subscribe(new Action1<Void>() {
                    @Override
                    public void call(Void aVoid) {
                        Intent intent = new Intent(mContext, AboutMe.class);
                        startActivity(intent);
                    }
                });

        RxView.clicks(settingLogoutLay).throttleFirst(500, TimeUnit.MILLISECONDS)
                .subscribe(new Action1<Void>() {
                    @Override
                    public void call(Void aVoid) {
                        GankIoApp.logout();
                    }
                });
    }

    private void doSuggest() {
        Uri uri = Uri.parse("mailto:yeming_1001@163.com");
        final Intent intent = new Intent(Intent.ACTION_SENDTO, uri);
        PackageManager pm = getPackageManager();
        List<ResolveInfo> infos = pm.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY);
        if (infos == null || infos.size() <= 0) {
            Toast.makeText(this, 0, Toast.LENGTH_SHORT).show();
            SnackbarUtil.showSnackBar(getWindow().getDecorView(), getResources().getString(R.string.setting_suggestions_tip));
            return;
        }
        startActivity(intent);
    }

    private void doSocre() {
        try {
            Uri uri = Uri.parse("market://details?id=" + mContext.getPackageName());
            Intent intent = new Intent(Intent.ACTION_VIEW, uri);
            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            startActivity(intent);
        }catch (ActivityNotFoundException e){
            SnackbarUtil.showSnackBar(getWindow().getDecorView(), getResources().getString(R.string.setting_socre_tip));

        }
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        int id = item.getItemId();
        switch (id) {
            case android.R.id.home:
                onBackPressed();
                break;
        }
        return true;
    }

}


text:
Function.prototype.inheritsFrom = function( parentClassOrObject ){
	if ( parentClassOrObject.constructor == Function ) {
		//Normal Inheritance
		this.prototype = new parentClassOrObject;
		this.prototype.constructor = this;
		this.prototype.parent = parentClassOrObject.prototype;
		parentClassOrObject.apply(this, arguments);
	} else {
		//Pure Virtual Inheritance
		this.prototype = parentClassOrObject;
		this.prototype.constructor = this;
		this.prototype.parent = parentClassOrObject;
	}
	return this;
};


text:
<?php

namespace Intervention\Image\Gd\Commands;

use Intervention\Image\Commands\AbstractCommand;
use Intervention\Image\Gd\Color;
use Intervention\Image\Gd\Decoder;

class FillCommand extends AbstractCommand
{
    /**
     * Fills image with color or pattern
     *
     * @param  \Intervention\Image\Image $image
     * @return boolean
     */
    public function execute($image)
    {
        $filling = $this->argument(0)->value();
        $x = $this->argument(1)->type('digit')->value();
        $y = $this->argument(2)->type('digit')->value();

        $width = $image->getWidth();
        $height = $image->getHeight();
        $resource = $image->getCore();

        try {

            // set image tile filling
            $source = new Decoder;
            $tile = $source->init($filling);
            imagesettile($image->getCore(), $tile->getCore());
            $filling = IMG_COLOR_TILED;

        } catch (\Intervention\Image\Exception\NotReadableException $e) {

            // set solid color filling
            $color = new Color($filling);
            $filling = $color->getInt();
        }

        imagealphablending($resource, true);

        if (is_int($x) && is_int($y)) {

            // resource should be visible through transparency
            $base = $image->getDriver()->newImage($width, $height)->getCore();
            imagecopy($base, $resource, 0, 0, 0, 0, $width, $height);

            // floodfill if exact position is defined
            imagefill($resource, $x, $y, $filling);

            // copy filled original over base
            imagecopy($base, $resource, 0, 0, 0, 0, $width, $height);

            // set base as new resource-core
            $image->setCore($base);
            imagedestroy($resource);

        } else {
            // fill whole image otherwise
            imagefilledrectangle($resource, 0, 0, $width - 1, $height - 1, $filling);
        }

        isset($tile) ? imagedestroy($tile->getCore()) : null;

        return true;
    }
}


text:
package org.apache.hive.hcatalog.streaming;

import com.google.common.annotations.VisibleForTesting;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.hive.conf.HiveConf;
import org.apache.hadoop.hive.metastore.MetaStoreUtils;
import org.apache.hadoop.hive.metastore.api.FieldSchema;
import org.apache.hadoop.hive.metastore.api.Table;
import org.apache.hadoop.hive.serde2.AbstractSerDe;
import org.apache.hadoop.hive.serde2.SerDe;
import org.apache.hadoop.hive.serde2.SerDeException;
import org.apache.hadoop.hive.serde2.SerDeUtils;
import org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe;
import org.apache.hadoop.io.BytesWritable;

import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;

/**
 * Streaming Writer handles delimited input (eg. CSV).
 * Delimited input is parsed & reordered to match column order in table
 * Uses Lazy Simple Serde to process delimited input
 */
public class DelimitedInputWriter extends AbstractRecordWriter {
  private final boolean reorderingNeeded;
  private String delimiter;
  private char serdeSeparator;
  private int[] fieldToColMapping;
  private final ArrayList<String> tableColumns;
  private AbstractSerDe serde = null;

  static final private Log LOG = LogFactory.getLog(DelimitedInputWriter.class.getName());

  /** Constructor. Uses default separator of the LazySimpleSerde
   * @param colNamesForFields Column name assignment for input fields. nulls or empty
   *                          strings in the array indicates the fields to be skipped
   * @param delimiter input field delimiter
   * @param endPoint Hive endpoint
   * @throws ConnectionError Problem talking to Hive
   * @throws ClassNotFoundException Serde class not found
   * @throws SerializationError Serde initialization/interaction failed
   * @throws StreamingException Problem acquiring file system path for partition
   * @throws InvalidColumn any element in colNamesForFields refers to a non existing column
   */
  public DelimitedInputWriter(String[] colNamesForFields, String delimiter,
                              HiveEndPoint endPoint)
          throws ClassNotFoundException, ConnectionError, SerializationError,
                 InvalidColumn, StreamingException {
    this(colNamesForFields, delimiter, endPoint, null);
  }

 /** Constructor. Uses default separator of the LazySimpleSerde
  * @param colNamesForFields Column name assignment for input fields. nulls or empty
  *                          strings in the array indicates the fields to be skipped
  * @param delimiter input field delimiter
  * @param endPoint Hive endpoint
  * @param conf a Hive conf object. Can be null if not using advanced hive settings.
  * @throws ConnectionError Problem talking to Hive
  * @throws ClassNotFoundException Serde class not found
  * @throws SerializationError Serde initialization/interaction failed
  * @throws StreamingException Problem acquiring file system path for partition
  * @throws InvalidColumn any element in colNamesForFields refers to a non existing column
  */
   public DelimitedInputWriter(String[] colNamesForFields, String delimiter,
                              HiveEndPoint endPoint, HiveConf conf)
          throws ClassNotFoundException, ConnectionError, SerializationError,
                 InvalidColumn, StreamingException {
     this(colNamesForFields, delimiter, endPoint, conf,
             (char) LazySimpleSerDe.DefaultSeparators[0]);
   }

  /**
   * Constructor. Allows overriding separator of the LazySimpleSerde
   * @param colNamesForFields Column name assignment for input fields
   * @param delimiter input field delimiter
   * @param endPoint Hive endpoint
   * @param conf a Hive conf object. Set to null if not using advanced hive settings.
   * @param serdeSeparator separator used when encoding data that is fed into the
   *                             LazySimpleSerde. Ensure this separator does not occur
   *                             in the field data
   * @throws ConnectionError Problem talking to Hive
   * @throws ClassNotFoundException Serde class not found
   * @throws SerializationError Serde initialization/interaction failed
   * @throws StreamingException Problem acquiring file system path for partition
   * @throws InvalidColumn any element in colNamesForFields refers to a non existing column
   */
  public DelimitedInputWriter(String[] colNamesForFields, String delimiter,
                              HiveEndPoint endPoint, HiveConf conf, char serdeSeparator)
          throws ClassNotFoundException, ConnectionError, SerializationError,
                 InvalidColumn, StreamingException {
    super(endPoint, conf);
    this.tableColumns = getCols(tbl);
    this.serdeSeparator = serdeSeparator;
    this.delimiter = delimiter;
    this.fieldToColMapping = getFieldReordering(colNamesForFields, getTableColumns());
    this.reorderingNeeded = isReorderingNeeded(delimiter, getTableColumns());
    LOG.debug("Field reordering needed = " + this.reorderingNeeded + ", for endpoint " + endPoint);
    this.serdeSeparator = serdeSeparator;
  }

  private boolean isReorderingNeeded(String delimiter, ArrayList<String> tableColumns) {
    return !( delimiter.equals(String.valueOf(getSerdeSeparator()))
            && areFieldsInColOrder(fieldToColMapping)
            && tableColumns.size()>=fieldToColMapping.length );
  }

  private static boolean areFieldsInColOrder(int[] fieldToColMapping) {
    for(int i=0; i<fieldToColMapping.length; ++i) {
      if(fieldToColMapping[i]!=i) {
        return false;
      }
    }
    return true;
  }

  @VisibleForTesting
  static int[] getFieldReordering(String[] colNamesForFields, List<String> tableColNames)
          throws InvalidColumn {
    int[] result = new int[ colNamesForFields.length ];
    for(int i=0; i<colNamesForFields.length; ++i) {
      result[i] = -1;
    }
    int i=-1, fieldLabelCount=0;
    for( String col : colNamesForFields ) {
      ++i;
      if(col == null) {
        continue;
      }
      if( col.trim().isEmpty() ) {
        continue;
      }
      ++fieldLabelCount;
      int loc = tableColNames.indexOf(col);
      if(loc == -1) {
        throw new InvalidColumn("Column '" + col + "' not found in table for input field " + i+1);
      }
      result[i] = loc;
    }
    if(fieldLabelCount>tableColNames.size()) {
      throw new InvalidColumn("Number of field names exceeds the number of columns in table");
    }
    return result;
  }

  // Reorder fields in record based on the order of columns in the table
  protected byte[] reorderFields(byte[] record) throws UnsupportedEncodingException {
    if(!reorderingNeeded) {
      return record;
    }
    String[] reorderedFields = new String[getTableColumns().size()];
    String decoded = new String(record);
    String[] fields = decoded.split(delimiter);
    for (int i=0; i<fieldToColMapping.length; ++i) {
      int newIndex = fieldToColMapping[i];
      if(newIndex != -1) {
        reorderedFields[newIndex] = fields[i];
      }
    }
    return join(reorderedFields,getSerdeSeparator());
  }

  // handles nulls in items[]
  // TODO: perhaps can be made more efficient by creating a byte[] directly
  private static byte[] join(String[] items, char separator) {
    StringBuffer buff = new StringBuffer(100);
    if(items.length == 0)
      return "".getBytes();
    int i=0;
    for(; i<items.length-1; ++i) {
      if(items[i]!=null) {
        buff.append(items[i]);
      }
      buff.append(separator);
    }
    if(items[i]!=null) {
      buff.append(items[i]);
    }
    return buff.toString().getBytes();
  }

  protected ArrayList<String> getTableColumns() {
    return tableColumns;
  }

  @Override
  public void write(long transactionId, byte[] record)
          throws SerializationError, StreamingIOFailure {
    try {
      byte[] orderedFields = reorderFields(record);
      Object encodedRow = encode(orderedFields);
      updater.insert(transactionId, encodedRow);
    } catch (IOException e) {
      throw new StreamingIOFailure("Error writing record in transaction ("
              + transactionId + ")", e);
    }
  }

  @Override
  SerDe getSerde() throws SerializationError {
    if(serde!=null) {
      return serde;
    }
    serde = createSerde(tbl, conf);
    return serde;
  }

  private Object encode(byte[] record) throws SerializationError {
    try {
      BytesWritable blob = new BytesWritable();
      blob.set(record, 0, record.length);
      return serde.deserialize(blob);
    } catch (SerDeException e) {
      throw new SerializationError("Unable to convert byte[] record into Object", e);
    }
  }

  /**
   * Creates LazySimpleSerde
   * @return
   * @throws SerializationError if serde could not be initialized
   * @param tbl
   */
  protected LazySimpleSerDe createSerde(Table tbl, HiveConf conf)
          throws SerializationError {
    try {
      Properties tableProps = MetaStoreUtils.getTableMetadata(tbl);
      tableProps.setProperty("field.delim", String.valueOf(serdeSeparator));
      LazySimpleSerDe serde = new LazySimpleSerDe();
      SerDeUtils.initializeSerDe(serde, conf, tableProps, null);
      return serde;
    } catch (SerDeException e) {
      throw new SerializationError("Error initializing serde", e);
    }
  }

  private ArrayList<String> getCols(Table table) {
    List<FieldSchema> cols = table.getSd().getCols();
    ArrayList<String> colNames = new ArrayList<String>(cols.size());
    for (FieldSchema col : cols) {
      colNames.add(col.getName().toLowerCase());
    }
    return  colNames;
  }

  public char getSerdeSeparator() {
    return serdeSeparator;
  }
}


text:
using System.Web.Mvc;
using System.Web.Routing;

namespace Jabbot.Web.Bootstrapper.Tasks
{
    internal class RegisterRouteBootstrapperTask : IBootstrapperPerApplicationTask
    {
        public void Execute()
        {
            var routes = RouteTable.Routes;

            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
            routes.IgnoreRoute("favicon.ico");

            routes.MapRoute(
                "Home",
                "",
                new { controller = "Home", action = "Get", id = UrlParameter.Optional }
            );

            routes.MapRoute(
                "Default",
                "{*url}",
                new { controller = "Error", action = "Http404" }
            );
        }
    }
}


text:
<?php

defined('_JEXEC') or die('Restricted access');
?><textarea style="width:99%;height:180px;" rows="10" name="textareaentries">
<?php $text = JRequest::getString("textareaentries");
if(empty($text)){ ?>
name,email
Adrien,adrien@example.com
John,john@example.com
<?php }else{
	echo $text;
} ?>
</textarea>


text:
<?php declare(strict_types = 1);

namespace Nextras\Orm\Collection\Aggregations;

use Nextras\Dbal\QueryBuilder\QueryBuilder;
use Nextras\Orm\Collection\Helpers\DbalExpressionResult;

interface IDbalAggregator extends IAggregator
{
	public function aggregateExpression(
		QueryBuilder $queryBuilder,
		DbalExpressionResult $expressionResult
	): DbalExpressionResult;
}


text:
.class public final Lcom/google/inject/internal/util/$Sets;
.super Ljava/lang/Object;
.source "Sets.java"

# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/google/inject/internal/util/$Sets$SetFromMap;
    }
.end annotation

# direct methods
.method private constructor <init>()V
    .locals 0

    .prologue
    .line 42
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method static hashCodeImpl(Ljava/util/Set;)I
    .locals 4
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/Set",
            "<*>;)I"
        }
    .end annotation

    .prologue
    .line 190
    .local p0, "s":Ljava/util/Set;, "Ljava/util/Set<*>;"
    const/4 v0, 0x0

    .line 191
    .local v0, "hashCode":I
    invoke-interface {p0}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v1

    .local v1, "i$":Ljava/util/Iterator;
    :goto_0
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v3

    if-eqz v3, :cond_1

    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v2

    .line 192
    .local v2, "o":Ljava/lang/Object;
    if-eqz v2, :cond_0

    invoke-virtual {v2}, Ljava/lang/Object;->hashCode()I

    move-result v3

    :goto_1
    add-int/2addr v0, v3

    goto :goto_0

    :cond_0
    const/4 v3, 0x0

    goto :goto_1

    .line 194
    .end local v2    # "o":Ljava/lang/Object;
    :cond_1
    return v0
.end method

.method public static newHashSet()Ljava/util/HashSet;
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "<E:",
            "Ljava/lang/Object;",
            ">()",
            "Ljava/util/HashSet",
            "<TE;>;"
        }
    .end annotation

    .prologue
    .line 58
    new-instance v0, Ljava/util/HashSet;

    invoke-direct {v0}, Ljava/util/HashSet;-><init>()V

    return-object v0
.end method

.method public static newLinkedHashSet()Ljava/util/LinkedHashSet;
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "<E:",
            "Ljava/lang/Object;",
            ">()",
            "Ljava/util/LinkedHashSet",
            "<TE;>;"
        }
    .end annotation

    .prologue
    .line 72
    new-instance v0, Ljava/util/LinkedHashSet;

    invoke-direct {v0}, Ljava/util/LinkedHashSet;-><init>()V

    return-object v0
.end method

.method public static newSetFromMap(Ljava/util/Map;)Ljava/util/Set;
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "<E:",
            "Ljava/lang/Object;",
            ">(",
            "Ljava/util/Map",
            "<TE;",
            "Ljava/lang/Boolean;",
            ">;)",
            "Ljava/util/Set",
            "<TE;>;"
        }
    .end annotation

    .prologue
    .line 115
    .local p0, "map":Ljava/util/Map;, "Ljava/util/Map<TE;Ljava/lang/Boolean;>;"
    new-instance v0, Lcom/google/inject/internal/util/$Sets$SetFromMap;

    invoke-direct {v0, p0}, Lcom/google/inject/internal/util/$Sets$SetFromMap;-><init>(Ljava/util/Map;)V

    return-object v0
.end method


text:
/**
 * @module ol/source/ImageArcGISRest
 */
import {inherits} from '../index.js';
import ImageWrapper from '../Image.js';
import {assert} from '../asserts.js';
import {listen} from '../events.js';
import EventType from '../events/EventType.js';
import {containsExtent, getHeight, getWidth} from '../extent.js';
import {assign} from '../obj.js';
import ImageSource, {defaultImageLoadFunction} from '../source/Image.js';
import {appendParams} from '../uri.js';

/**
 * @classdesc
 * Source for data from ArcGIS Rest services providing single, untiled images.
 * Useful when underlying map service has labels.
 *
 * If underlying map service is not using labels,
 * take advantage of ol image caching and use
 * {@link ol.source.TileArcGISRest} data source.
 *
 * @constructor
 * @fires ol.source.Image.Event
 * @extends {ol.source.Image}
 * @param {olx.source.ImageArcGISRestOptions=} opt_options Image ArcGIS Rest Options.
 * @api
 */
const ImageArcGISRest = function(opt_options) {

  const options = opt_options || {};

  ImageSource.call(this, {
    attributions: options.attributions,
    projection: options.projection,
    resolutions: options.resolutions
  });

  /**
   * @private
   * @type {?string}
   */
  this.crossOrigin_ =
      options.crossOrigin !== undefined ? options.crossOrigin : null;

  /**
   * @private
   * @type {boolean}
   */
  this.hidpi_ = options.hidpi !== undefined ? options.hidpi : true;

  /**
   * @private
   * @type {string|undefined}
   */
  this.url_ = options.url;

  /**
   * @private
   * @type {module:ol/Image~LoadFunction}
   */
  this.imageLoadFunction_ = options.imageLoadFunction !== undefined ?
    options.imageLoadFunction : defaultImageLoadFunction;

  /**
   * @private
   * @type {!Object}
   */
  this.params_ = options.params || {};

  /**
   * @private
   * @type {ol.Image}
   */
  this.image_ = null;

  /**
   * @private
   * @type {module:ol/size~Size}
   */
  this.imageSize_ = [0, 0];

  /**
   * @private
   * @type {number}
   */
  this.renderedRevision_ = 0;

  /**
   * @private
   * @type {number}
   */
  this.ratio_ = options.ratio !== undefined ? options.ratio : 1.5;

};

inherits(ImageArcGISRest, ImageSource);

/**
 * Get the user-provided params, i.e. those passed to the constructor through
 * the "params" option, and possibly updated using the updateParams method.
 * @return {Object} Params.
 * @api
 */
ImageArcGISRest.prototype.getParams = function() {
  return this.params_;
};

/**
 * @inheritDoc
 */
ImageArcGISRest.prototype.getImageInternal = function(extent, resolution, pixelRatio, projection) {

  if (this.url_ === undefined) {
    return null;
  }

  resolution = this.findNearestResolution(resolution);
  pixelRatio = this.hidpi_ ? pixelRatio : 1;

  const image = this.image_;
  if (image &&
      this.renderedRevision_ == this.getRevision() &&
      image.getResolution() == resolution &&
      image.getPixelRatio() == pixelRatio &&
      containsExtent(image.getExtent(), extent)) {
    return image;
  }

  const params = {
    'F': 'image',
    'FORMAT': 'PNG32',
    'TRANSPARENT': true
  };
  assign(params, this.params_);

  extent = extent.slice();
  const centerX = (extent[0] + extent[2]) / 2;
  const centerY = (extent[1] + extent[3]) / 2;
  if (this.ratio_ != 1) {
    const halfWidth = this.ratio_ * getWidth(extent) / 2;
    const halfHeight = this.ratio_ * getHeight(extent) / 2;
    extent[0] = centerX - halfWidth;
    extent[1] = centerY - halfHeight;
    extent[2] = centerX + halfWidth;
    extent[3] = centerY + halfHeight;
  }

  const imageResolution = resolution / pixelRatio;

  // Compute an integer width and height.
  const width = Math.ceil(getWidth(extent) / imageResolution);
  const height = Math.ceil(getHeight(extent) / imageResolution);

  // Modify the extent to match the integer width and height.
  extent[0] = centerX - imageResolution * width / 2;
  extent[2] = centerX + imageResolution * width / 2;
  extent[1] = centerY - imageResolution * height / 2;
  extent[3] = centerY + imageResolution * height / 2;

  this.imageSize_[0] = width;
  this.imageSize_[1] = height;

  const url = this.getRequestUrl_(extent, this.imageSize_, pixelRatio,
    projection, params);

  this.image_ = new ImageWrapper(extent, resolution, pixelRatio,
    url, this.crossOrigin_, this.imageLoadFunction_);

  this.renderedRevision_ = this.getRevision();

  listen(this.image_, EventType.CHANGE,
    this.handleImageChange, this);

  return this.image_;

};

/**
 * Return the image load function of the source.
 * @return {module:ol/Image~LoadFunction} The image load function.
 * @api
 */
ImageArcGISRest.prototype.getImageLoadFunction = function() {
  return this.imageLoadFunction_;
};

/**
 * @param {module:ol/extent~Extent} extent Extent.
 * @param {module:ol/size~Size} size Size.
 * @param {number} pixelRatio Pixel ratio.
 * @param {module:ol/proj/Projection~Projection} projection Projection.
 * @param {Object} params Params.
 * @return {string} Request URL.
 * @private
 */
ImageArcGISRest.prototype.getRequestUrl_ = function(extent, size, pixelRatio, projection, params) {
  // ArcGIS Server only wants the numeric portion of the projection ID.
  const srid = projection.getCode().split(':').pop();

  params['SIZE'] = size[0] + ',' + size[1];
  params['BBOX'] = extent.join(',');
  params['BBOXSR'] = srid;
  params['IMAGESR'] = srid;
  params['DPI'] = Math.round(90 * pixelRatio);

  const url = this.url_;

  const modifiedUrl = url
    .replace(/MapServer\/?$/, 'MapServer/export')
    .replace(/ImageServer\/?$/, 'ImageServer/exportImage');
  if (modifiedUrl == url) {
    assert(false, 50); // `options.featureTypes` should be an Array
  }
  return appendParams(modifiedUrl, params);
};

/**
 * Return the URL used for this ArcGIS source.
 * @return {string|undefined} URL.
 * @api
 */
ImageArcGISRest.prototype.getUrl = function() {
  return this.url_;
};

/**
 * Set the image load function of the source.
 * @param {module:ol/Image~LoadFunction} imageLoadFunction Image load function.
 * @api
 */
ImageArcGISRest.prototype.setImageLoadFunction = function(imageLoadFunction) {
  this.image_ = null;
  this.imageLoadFunction_ = imageLoadFunction;
  this.changed();
};

/**
 * Set the URL to use for requests.
 * @param {string|undefined} url URL.
 * @api
 */
ImageArcGISRest.prototype.setUrl = function(url) {
  if (url != this.url_) {
    this.url_ = url;
    this.image_ = null;
    this.changed();
  }
};

/**
 * Update the user-provided params.
 * @param {Object} params Params.
 * @api
 */
ImageArcGISRest.prototype.updateParams = function(params) {
  assign(this.params_, params);
  this.image_ = null;
  this.changed();
};
export default ImageArcGISRest;


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <title>2048 - Chess</title>

  <link href="style/main.css" rel="stylesheet" type="text/css">

2048 - Chess

Number of current players:

Number of current games:

Join the numbers and get to the 2048 tile! Take one move at one time!

0

            Find a Competitor!

0

      How to play: Use your arrow keys to move the tiles. When two tiles with the same number touch, they merge into one!

     Created by Gabriele Cirulli. Based on 1024 by Veewo Studio.  Multiplayer added by Emil Stolarsky. Modified to chess version by Gan Yue.


text:
<?php

require __DIR__.'/vendor/autoload.php';

$myex = new \Example\MyExample();
$myex->hello();


text:
class SupersizeFormBuilder < SimpleForm::FormBuilder
  def input(attribute_name, options = {}, &block)
    options[:input_html].nil? ? options[:input_html] = {:class => 'supersize'} : options[:input_html].merge!({:class => 'medium'})
    options[:error_html].nil? ? options[:error_html] = {:class => 'supersize'} : options[:error_html].merge!({:class => 'medium'})
    super
  end
end


text:
"""
    Abstract Classes to do composition by inheterince
    and some other utitities from base clases

    * Stream: Abstract Class for implementation of a Stream

    * Decorator: Abstract Class for creating new decorators

"""
from __future__ import unicode_literals
from abc import abstractmethod, ABCMeta
from .general import with_metaclass

class Stream(with_metaclass(ABCMeta)):
    """A base class whose is specify a Stream is

    We need at least a stream on init and a
    message param on write method

    """

    @abstractmethod
    def __init__(self, stream, **kargs):
        pass

    @abstractmethod
    def write(self, message, optional=None):
        """a write method interfacing sys.stdout or sys.stderr"""
        pass

class DecoratorManager(with_metaclass(ABCMeta)):
    """Decorator-Context-Manager base class to keep easy creating more decorators

    argument: can be empty or a callable object (function or class)
    """

    @abstractmethod
    def __call__(self, function):
        """Base class to handle all the implementation of decorators"""
        pass

    @abstractmethod
    def start(self):
        """You active here your pre-fucking crazy feature"""
        pass

    @abstractmethod
    def stop(self):
        """You can deactivate any behavior re-writing your method here"""
        pass

    def __enter__(self):
        """Activated when enter in a context-manager (with keyword)"""
        self.start()

    def __exit__(self, *args):
        """Triggered when exit from a block of context-manager"""
        self.stop()


text:
export var Exists;
(function (Exists) {
    Exists[Exists["ShouldExist"] = 0] = "ShouldExist";
    Exists[Exists["ShouldCreate"] = 1] = "ShouldCreate";
    Exists[Exists["MayExist"] = 2] = "MayExist";
})(Exists || (Exists = {}));
// Interface that drivers must support.
//
// Note the threading of a version number here; each model provided
// by the driver to the Store (using the receiver) is paired with a version,
// as is each model sent from the Store to the driver (using Driver.send()).
//
// This threading is used to track whether driver state has changed while
// the Store is processing a particular model. send() should always fail
// if the version isn't exactly 1 greater than the current internal version.
export class Driver {
    constructor(storageKey, exists) {
        this.storageKey = storageKey;
        this.exists = exists;
    }
}
//# sourceMappingURL=driver.js.map


text:
var Firebase = require('firebase');
var chai = require('chai');
var sinon = require('sinon');
var sinonChai = require('sinon-chai');
var chaiAsPromised = require("chai-as-promised");
var expect = chai.expect;
chai.use(sinonChai);
chai.use(chaiAsPromised);

describe('e2e tests::', function () {
  this.timeout(10000);
  var service;
  var provider;
  var spy;
  before(function () {
    var StorageProvider = require('le-storage-provider-firebase');
    var StorageService = require('le-storage-service');
    var firebaseUrl = process.env.FIREBASE_URL;
    var firebaseRef = new Firebase(firebaseUrl);
    var storage = new StorageService(new StorageProvider(firebaseRef));
    var JobQueueProvider = require('le-job-queue-provider-firebase');
    var JobQueueService = require('../../src/index.js');
    provider = new JobQueueProvider(firebaseRef);
    service = new JobQueueService(storage);
  });
  it('should respect logic', function () {
    expect(true).to.be.true;
    expect(true).not.to.be.false;
  });
  it('should create a worker to process the jobs', function (done) {
    spy = sinon.spy();
    var promise = service.addJob('welcome-email', { name: 'Tom' })
    .then(function () {
      var processJob = function (data, complete) {
        spy();
        complete();
      }
      service.createWorker(provider, processJob);
      setTimeout(function () { // give the worker time to do it's thang
        expect(spy).to.have.been.calledOnce;
        done();
      }, 3000);
    });
  });
  it('should add two more jobs', function () {
    var promise = service.addJob('welcome-email', { name: 'Amy' })
    .then(function () {
      return service.addJob('welcome-email', { name: 'Scott' });
    })
    return expect(promise).to.eventually.be.resolved;
  });
  it('should process the two new jobs as well', function (done) {
    setTimeout(function () { // give the worker time to do it's thang
      expect(spy).to.have.been.calledThrice;
      done();
    }, 5000);
  });
});


text:
<?php
App::uses('UsersController', 'User.Controller');

/**
 * UsersController Test Case
 *
 */
class UsersControllerTest extends ControllerTestCase {

/**
 * Fixtures
 *
 * @var array
 */
	public $fixtures = array(
		'plugin.user.user',
		'plugin.user.group'
	);

/**
 * testAdminIndex method
 *
 * @return void
 */
	public function testAdminIndex() {
	}

/**
 * testAdminView method
 *
 * @return void
 */
	public function testAdminView() {
	}

/**
 * testAdminAdd method
 *
 * @return void
 */
	public function testAdminAdd() {
	}

/**
 * testAdminEdit method
 *
 * @return void
 */
	public function testAdminEdit() {
	}

/**
 * testAdminDelete method
 *
 * @return void
 */
	public function testAdminDelete() {
	}

}


text:
package edu.pdx.cs410J.di;

/**
 * The abstract super class of mock objects used for testing
 */
public abstract class MockObject
{
    /**
     * Throws an exception because this method (or rather the method of a mock object that calls it) is not expected
     * to be invoked during expected regular test execution.
     */
    protected void shouldNotInvoke()
    {
        throw new UnsupportedOperationException( "Did not expect this method to be invoked" );
    }
}


text:
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE121_Stack_Based_Buffer_Overflow__CWE805_wchar_t_alloca_ncpy_74b.cpp
Label Definition File: CWE121_Stack_Based_Buffer_Overflow__CWE805.string.label.xml
Template File: sources-sink-74b.tmpl.cpp
*/
/*
 * @description
 * CWE: 121 Stack Based Buffer Overflow
 * BadSource:  Set data pointer to the bad buffer
 * GoodSource: Set data pointer to the good buffer
 * Sinks: ncpy
 *    BadSink : Copy string to data using wcsncpy
 * Flow Variant: 74 Data flow: data passed in a map from one function to another in different source files
 *
 * */

#include "std_testcase.h"
#include <map>

#include <wchar.h>

using namespace std;

namespace CWE121_Stack_Based_Buffer_Overflow__CWE805_wchar_t_alloca_ncpy_74
{

#ifndef OMITBAD

void badSink(map<int, wchar_t *> dataMap)
{
    /* copy data out of dataMap */
    wchar_t * data = dataMap[2];
    {
        wchar_t source[100];
        wmemset(source, L'C', 100-1); /* fill with L'C's */
        source[100-1] = L'\0'; /* null terminate */
        /* POTENTIAL FLAW: Possible buffer overflow if the size of data is less than the length of source */
        wcsncpy(data, source, 100-1);
        data[100-1] = L'\0'; /* Ensure the destination buffer is null terminated */
        printWLine(data);
    }
}

#endif /* OMITBAD */

#ifndef OMITGOOD

/* goodG2B uses the GoodSource with the BadSink */
void goodG2BSink(map<int, wchar_t *> dataMap)
{
    wchar_t * data = dataMap[2];
    {
        wchar_t source[100];
        wmemset(source, L'C', 100-1); /* fill with L'C's */
        source[100-1] = L'\0'; /* null terminate */
        /* POTENTIAL FLAW: Possible buffer overflow if the size of data is less than the length of source */
        wcsncpy(data, source, 100-1);
        data[100-1] = L'\0'; /* Ensure the destination buffer is null terminated */
        printWLine(data);
    }
}

#endif /* OMITGOOD */

} /* close namespace */