HashAlgorithm.java

// Generated by the protocol buffer compiler.  DO NOT EDIT!
// NO CHECKED-IN PROTOBUF GENCODE
// source: sigstore_common.proto
// Protobuf Java Version: 4.30.2

package dev.sigstore.proto.common.v1;

/**
 * <pre>
 * Only a subset of the secure hash standard algorithms are supported.
 * See &lt;https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf&gt; for more
 * details.
 * UNSPECIFIED SHOULD not be used, primary reason for inclusion is to force
 * any proto JSON serialization to emit the used hash algorithm, as default
 * option is to *omit* the default value of an enum (which is the first
 * value, represented by '0'.
 * </pre>
 *
 * Protobuf enum {@code dev.sigstore.common.v1.HashAlgorithm}
 */
@javax.annotation.Generated(value="protoc", comments="annotations:HashAlgorithm.java.pb.meta")
public enum HashAlgorithm
    implements com.google.protobuf.ProtocolMessageEnum {
  /**
   * <code>HASH_ALGORITHM_UNSPECIFIED = 0;</code>
   */
  HASH_ALGORITHM_UNSPECIFIED(0),
  /**
   * <code>SHA2_256 = 1;</code>
   */
  SHA2_256(1),
  /**
   * <code>SHA2_384 = 2;</code>
   */
  SHA2_384(2),
  /**
   * <code>SHA2_512 = 3;</code>
   */
  SHA2_512(3),
  /**
   * <code>SHA3_256 = 4;</code>
   */
  SHA3_256(4),
  /**
   * <code>SHA3_384 = 5;</code>
   */
  SHA3_384(5),
  UNRECOGNIZED(-1),
  ;

  static {
    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
      com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
      /* major= */ 4,
      /* minor= */ 30,
      /* patch= */ 2,
      /* suffix= */ "",
      HashAlgorithm.class.getName());
  }
  /**
   * <code>HASH_ALGORITHM_UNSPECIFIED = 0;</code>
   */
  public static final int HASH_ALGORITHM_UNSPECIFIED_VALUE = 0;
  /**
   * <code>SHA2_256 = 1;</code>
   */
  public static final int SHA2_256_VALUE = 1;
  /**
   * <code>SHA2_384 = 2;</code>
   */
  public static final int SHA2_384_VALUE = 2;
  /**
   * <code>SHA2_512 = 3;</code>
   */
  public static final int SHA2_512_VALUE = 3;
  /**
   * <code>SHA3_256 = 4;</code>
   */
  public static final int SHA3_256_VALUE = 4;
  /**
   * <code>SHA3_384 = 5;</code>
   */
  public static final int SHA3_384_VALUE = 5;


  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 HashAlgorithm 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 HashAlgorithm forNumber(int value) {
    switch (value) {
      case 0: return HASH_ALGORITHM_UNSPECIFIED;
      case 1: return SHA2_256;
      case 2: return SHA2_384;
      case 3: return SHA2_512;
      case 4: return SHA3_256;
      case 5: return SHA3_384;
      default: return null;
    }
  }

  public static com.google.protobuf.Internal.EnumLiteMap<HashAlgorithm>
      internalGetValueMap() {
    return internalValueMap;
  }
  private static final com.google.protobuf.Internal.EnumLiteMap<
      HashAlgorithm> internalValueMap =
        new com.google.protobuf.Internal.EnumLiteMap<HashAlgorithm>() {
          public HashAlgorithm findValueByNumber(int number) {
            return HashAlgorithm.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 dev.sigstore.proto.common.v1.CommonProto.getDescriptor().getEnumTypes().get(0);
  }

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

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

  // @@protoc_insertion_point(enum_scope:dev.sigstore.common.v1.HashAlgorithm)
}