com.hedera.hashgraph.sdk.proto.BlockHashAlgorithm Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sdk-full Show documentation
Show all versions of sdk-full Show documentation
Hedera™ Hashgraph SDK for Java
The newest version!
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: basic_types.proto
// Protobuf Java Version: 3.25.3
package com.hedera.hashgraph.sdk.proto;
/**
*
**
* A specific hash algorithm.
*
* We did not reuse Record Stream `HashAlgorithm` here because in all cases,
* currently, this will be `SHA2_384` and if that is the default value then
* we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN`
* is the default for Record Stream `HashAlgorithm`.
*
* Note that enum values here MUST NOT match the name of any other enum value
* in the same `package`, as protobuf follows `C++` scope rules and all enum
* _names_ are treated as global constants within the `package`.
*
*
* Protobuf enum {@code proto.BlockHashAlgorithm}
*/
public enum BlockHashAlgorithm
implements com.google.protobuf.ProtocolMessageEnum {
/**
*
**
* A SHA2 algorithm SHA-384 hash.
* <p>
* This is the default value, if a field of this enumerated type is
* not set, then this is the value that will be decoded when the
* serialized message is read.
*
*
* SHA2_384 = 0;
*/
SHA2_384(0),
UNRECOGNIZED(-1),
;
/**
*
**
* A SHA2 algorithm SHA-384 hash.
* <p>
* This is the default value, if a field of this enumerated type is
* not set, then this is the value that will be decoded when the
* serialized message is read.
*
*
* SHA2_384 = 0;
*/
public static final int SHA2_384_VALUE = 0;
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 BlockHashAlgorithm 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 BlockHashAlgorithm forNumber(int value) {
switch (value) {
case 0: return SHA2_384;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap
internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap<
BlockHashAlgorithm> internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap() {
public BlockHashAlgorithm findValueByNumber(int number) {
return BlockHashAlgorithm.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.hedera.hashgraph.sdk.proto.BasicTypes.getDescriptor().getEnumTypes().get(0);
}
private static final BlockHashAlgorithm[] VALUES = values();
public static BlockHashAlgorithm 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 BlockHashAlgorithm(int value) {
this.value = value;
}
// @@protoc_insertion_point(enum_scope:proto.BlockHashAlgorithm)
}