com.hedera.hapi.block.stream.output.protoc.UtilPrngOutput Maven / Gradle / Ivy
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: stream/output/util_service.proto
package com.hedera.hapi.block.stream.output.protoc;
/**
*
**
* Block data produced by `prng` transactions submitted to the `Util` service.
* The `entropy` reported in this block stream message is deterministically
* produced, but has high dispersion and is very difficult to predict.
* This message SHALL NOT duplicate information already contained in
* the original transaction.
*
*
* Protobuf type {@code com.hedera.hapi.block.stream.output.UtilPrngOutput}
*/
public final class UtilPrngOutput extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:com.hedera.hapi.block.stream.output.UtilPrngOutput)
UtilPrngOutputOrBuilder {
private static final long serialVersionUID = 0L;
// Use UtilPrngOutput.newBuilder() to construct.
private UtilPrngOutput(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private UtilPrngOutput() {
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new UtilPrngOutput();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private UtilPrngOutput(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
entropyCase_ = 1;
entropy_ = input.readBytes();
break;
}
case 16: {
entropyCase_ = 2;
entropy_ = input.readUInt32();
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.hedera.hapi.block.stream.output.protoc.UtilService.internal_static_com_hedera_hapi_block_stream_output_UtilPrngOutput_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.hedera.hapi.block.stream.output.protoc.UtilService.internal_static_com_hedera_hapi_block_stream_output_UtilPrngOutput_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.hedera.hapi.block.stream.output.protoc.UtilPrngOutput.class, com.hedera.hapi.block.stream.output.protoc.UtilPrngOutput.Builder.class);
}
private int entropyCase_ = 0;
private java.lang.Object entropy_;
public enum EntropyCase
implements com.google.protobuf.Internal.EnumLite,
com.google.protobuf.AbstractMessage.InternalOneOfEnum {
PRNG_BYTES(1),
PRNG_NUMBER(2),
ENTROPY_NOT_SET(0);
private final int value;
private EntropyCase(int value) {
this.value = value;
}
/**
* @param value The number of the enum to look for.
* @return The enum associated with the given number.
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static EntropyCase valueOf(int value) {
return forNumber(value);
}
public static EntropyCase forNumber(int value) {
switch (value) {
case 1: return PRNG_BYTES;
case 2: return PRNG_NUMBER;
case 0: return ENTROPY_NOT_SET;
default: return null;
}
}
public int getNumber() {
return this.value;
}
};
public EntropyCase
getEntropyCase() {
return EntropyCase.forNumber(
entropyCase_);
}
public static final int PRNG_BYTES_FIELD_NUMBER = 1;
/**
*
**
* A deterministic pseudo-random sequence of 48 bytes.
* <p>
* This value SHALL be the result of a corresponding
* `UtilService` `prng` transaction.
*
*
* bytes prng_bytes = 1;
* @return Whether the prngBytes field is set.
*/
@java.lang.Override
public boolean hasPrngBytes() {
return entropyCase_ == 1;
}
/**
*
**
* A deterministic pseudo-random sequence of 48 bytes.
* <p>
* This value SHALL be the result of a corresponding
* `UtilService` `prng` transaction.
*
*
* bytes prng_bytes = 1;
* @return The prngBytes.
*/
@java.lang.Override
public com.google.protobuf.ByteString getPrngBytes() {
if (entropyCase_ == 1) {
return (com.google.protobuf.ByteString) entropy_;
}
return com.google.protobuf.ByteString.EMPTY;
}
public static final int PRNG_NUMBER_FIELD_NUMBER = 2;
/**
*
**
* A deterministic pseudo-random number generated within a
* specified range.
* <p>
* This value SHALL be the result of a corresponding `UtilService`
* `prng` transaction.<br/>
* Note that the transaction only permits a non-negative range, the
* output SHALL always be a whole number.
*
*
* uint32 prng_number = 2;
* @return Whether the prngNumber field is set.
*/
@java.lang.Override
public boolean hasPrngNumber() {
return entropyCase_ == 2;
}
/**
*
**
* A deterministic pseudo-random number generated within a
* specified range.
* <p>
* This value SHALL be the result of a corresponding `UtilService`
* `prng` transaction.<br/>
* Note that the transaction only permits a non-negative range, the
* output SHALL always be a whole number.
*
*
* uint32 prng_number = 2;
* @return The prngNumber.
*/
@java.lang.Override
public int getPrngNumber() {
if (entropyCase_ == 2) {
return (java.lang.Integer) entropy_;
}
return 0;
}
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 (entropyCase_ == 1) {
output.writeBytes(
1, (com.google.protobuf.ByteString) entropy_);
}
if (entropyCase_ == 2) {
output.writeUInt32(
2, (int)((java.lang.Integer) entropy_));
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (entropyCase_ == 1) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(
1, (com.google.protobuf.ByteString) entropy_);
}
if (entropyCase_ == 2) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(
2, (int)((java.lang.Integer) entropy_));
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof com.hedera.hapi.block.stream.output.protoc.UtilPrngOutput)) {
return super.equals(obj);
}
com.hedera.hapi.block.stream.output.protoc.UtilPrngOutput other = (com.hedera.hapi.block.stream.output.protoc.UtilPrngOutput) obj;
if (!getEntropyCase().equals(other.getEntropyCase())) return false;
switch (entropyCase_) {
case 1:
if (!getPrngBytes()
.equals(other.getPrngBytes())) return false;
break;
case 2:
if (getPrngNumber()
!= other.getPrngNumber()) return false;
break;
case 0:
default:
}
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
switch (entropyCase_) {
case 1:
hash = (37 * hash) + PRNG_BYTES_FIELD_NUMBER;
hash = (53 * hash) + getPrngBytes().hashCode();
break;
case 2:
hash = (37 * hash) + PRNG_NUMBER_FIELD_NUMBER;
hash = (53 * hash) + getPrngNumber();
break;
case 0:
default:
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.hedera.hapi.block.stream.output.protoc.UtilPrngOutput parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.hedera.hapi.block.stream.output.protoc.UtilPrngOutput parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.hedera.hapi.block.stream.output.protoc.UtilPrngOutput parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.hedera.hapi.block.stream.output.protoc.UtilPrngOutput parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.hedera.hapi.block.stream.output.protoc.UtilPrngOutput parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.hedera.hapi.block.stream.output.protoc.UtilPrngOutput parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.hedera.hapi.block.stream.output.protoc.UtilPrngOutput parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.hedera.hapi.block.stream.output.protoc.UtilPrngOutput 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.hedera.hapi.block.stream.output.protoc.UtilPrngOutput parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static com.hedera.hapi.block.stream.output.protoc.UtilPrngOutput 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.hedera.hapi.block.stream.output.protoc.UtilPrngOutput parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.hedera.hapi.block.stream.output.protoc.UtilPrngOutput 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.hedera.hapi.block.stream.output.protoc.UtilPrngOutput 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;
}
/**
*
**
* Block data produced by `prng` transactions submitted to the `Util` service.
* The `entropy` reported in this block stream message is deterministically
* produced, but has high dispersion and is very difficult to predict.
* This message SHALL NOT duplicate information already contained in
* the original transaction.
*
*
* Protobuf type {@code com.hedera.hapi.block.stream.output.UtilPrngOutput}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:com.hedera.hapi.block.stream.output.UtilPrngOutput)
com.hedera.hapi.block.stream.output.protoc.UtilPrngOutputOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.hedera.hapi.block.stream.output.protoc.UtilService.internal_static_com_hedera_hapi_block_stream_output_UtilPrngOutput_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.hedera.hapi.block.stream.output.protoc.UtilService.internal_static_com_hedera_hapi_block_stream_output_UtilPrngOutput_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.hedera.hapi.block.stream.output.protoc.UtilPrngOutput.class, com.hedera.hapi.block.stream.output.protoc.UtilPrngOutput.Builder.class);
}
// Construct using com.hedera.hapi.block.stream.output.protoc.UtilPrngOutput.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@java.lang.Override
public Builder clear() {
super.clear();
entropyCase_ = 0;
entropy_ = null;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.hedera.hapi.block.stream.output.protoc.UtilService.internal_static_com_hedera_hapi_block_stream_output_UtilPrngOutput_descriptor;
}
@java.lang.Override
public com.hedera.hapi.block.stream.output.protoc.UtilPrngOutput getDefaultInstanceForType() {
return com.hedera.hapi.block.stream.output.protoc.UtilPrngOutput.getDefaultInstance();
}
@java.lang.Override
public com.hedera.hapi.block.stream.output.protoc.UtilPrngOutput build() {
com.hedera.hapi.block.stream.output.protoc.UtilPrngOutput result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.hedera.hapi.block.stream.output.protoc.UtilPrngOutput buildPartial() {
com.hedera.hapi.block.stream.output.protoc.UtilPrngOutput result = new com.hedera.hapi.block.stream.output.protoc.UtilPrngOutput(this);
if (entropyCase_ == 1) {
result.entropy_ = entropy_;
}
if (entropyCase_ == 2) {
result.entropy_ = entropy_;
}
result.entropyCase_ = entropyCase_;
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.hedera.hapi.block.stream.output.protoc.UtilPrngOutput) {
return mergeFrom((com.hedera.hapi.block.stream.output.protoc.UtilPrngOutput)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.hedera.hapi.block.stream.output.protoc.UtilPrngOutput other) {
if (other == com.hedera.hapi.block.stream.output.protoc.UtilPrngOutput.getDefaultInstance()) return this;
switch (other.getEntropyCase()) {
case PRNG_BYTES: {
setPrngBytes(other.getPrngBytes());
break;
}
case PRNG_NUMBER: {
setPrngNumber(other.getPrngNumber());
break;
}
case ENTROPY_NOT_SET: {
break;
}
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
com.hedera.hapi.block.stream.output.protoc.UtilPrngOutput parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (com.hedera.hapi.block.stream.output.protoc.UtilPrngOutput) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int entropyCase_ = 0;
private java.lang.Object entropy_;
public EntropyCase
getEntropyCase() {
return EntropyCase.forNumber(
entropyCase_);
}
public Builder clearEntropy() {
entropyCase_ = 0;
entropy_ = null;
onChanged();
return this;
}
/**
*
**
* A deterministic pseudo-random sequence of 48 bytes.
* <p>
* This value SHALL be the result of a corresponding
* `UtilService` `prng` transaction.
*
*
* bytes prng_bytes = 1;
* @return Whether the prngBytes field is set.
*/
public boolean hasPrngBytes() {
return entropyCase_ == 1;
}
/**
*
**
* A deterministic pseudo-random sequence of 48 bytes.
* <p>
* This value SHALL be the result of a corresponding
* `UtilService` `prng` transaction.
*
*
* bytes prng_bytes = 1;
* @return The prngBytes.
*/
public com.google.protobuf.ByteString getPrngBytes() {
if (entropyCase_ == 1) {
return (com.google.protobuf.ByteString) entropy_;
}
return com.google.protobuf.ByteString.EMPTY;
}
/**
*
**
* A deterministic pseudo-random sequence of 48 bytes.
* <p>
* This value SHALL be the result of a corresponding
* `UtilService` `prng` transaction.
*
*
* bytes prng_bytes = 1;
* @param value The prngBytes to set.
* @return This builder for chaining.
*/
public Builder setPrngBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
entropyCase_ = 1;
entropy_ = value;
onChanged();
return this;
}
/**
*
**
* A deterministic pseudo-random sequence of 48 bytes.
* <p>
* This value SHALL be the result of a corresponding
* `UtilService` `prng` transaction.
*
*
* bytes prng_bytes = 1;
* @return This builder for chaining.
*/
public Builder clearPrngBytes() {
if (entropyCase_ == 1) {
entropyCase_ = 0;
entropy_ = null;
onChanged();
}
return this;
}
/**
*
**
* A deterministic pseudo-random number generated within a
* specified range.
* <p>
* This value SHALL be the result of a corresponding `UtilService`
* `prng` transaction.<br/>
* Note that the transaction only permits a non-negative range, the
* output SHALL always be a whole number.
*
*
* uint32 prng_number = 2;
* @return Whether the prngNumber field is set.
*/
public boolean hasPrngNumber() {
return entropyCase_ == 2;
}
/**
*
**
* A deterministic pseudo-random number generated within a
* specified range.
* <p>
* This value SHALL be the result of a corresponding `UtilService`
* `prng` transaction.<br/>
* Note that the transaction only permits a non-negative range, the
* output SHALL always be a whole number.
*
*
* uint32 prng_number = 2;
* @return The prngNumber.
*/
public int getPrngNumber() {
if (entropyCase_ == 2) {
return (java.lang.Integer) entropy_;
}
return 0;
}
/**
*
**
* A deterministic pseudo-random number generated within a
* specified range.
* <p>
* This value SHALL be the result of a corresponding `UtilService`
* `prng` transaction.<br/>
* Note that the transaction only permits a non-negative range, the
* output SHALL always be a whole number.
*
*
* uint32 prng_number = 2;
* @param value The prngNumber to set.
* @return This builder for chaining.
*/
public Builder setPrngNumber(int value) {
entropyCase_ = 2;
entropy_ = value;
onChanged();
return this;
}
/**
*
**
* A deterministic pseudo-random number generated within a
* specified range.
* <p>
* This value SHALL be the result of a corresponding `UtilService`
* `prng` transaction.<br/>
* Note that the transaction only permits a non-negative range, the
* output SHALL always be a whole number.
*
*
* uint32 prng_number = 2;
* @return This builder for chaining.
*/
public Builder clearPrngNumber() {
if (entropyCase_ == 2) {
entropyCase_ = 0;
entropy_ = null;
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:com.hedera.hapi.block.stream.output.UtilPrngOutput)
}
// @@protoc_insertion_point(class_scope:com.hedera.hapi.block.stream.output.UtilPrngOutput)
private static final com.hedera.hapi.block.stream.output.protoc.UtilPrngOutput DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.hedera.hapi.block.stream.output.protoc.UtilPrngOutput();
}
public static com.hedera.hapi.block.stream.output.protoc.UtilPrngOutput getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public UtilPrngOutput parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new UtilPrngOutput(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public com.hedera.hapi.block.stream.output.protoc.UtilPrngOutput getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy