com.hedera.hashgraph.sdk.proto.StakingInfo 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;
/**
*
**
* Staking metadata for an account or a contract returned in CryptoGetInfo or ContractGetInfo queries
*
*
* Protobuf type {@code proto.StakingInfo}
*/
public final class StakingInfo extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:proto.StakingInfo)
StakingInfoOrBuilder {
private static final long serialVersionUID = 0L;
// Use StakingInfo.newBuilder() to construct.
private StakingInfo(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private StakingInfo() {
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new StakingInfo();
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.hedera.hashgraph.sdk.proto.BasicTypes.internal_static_proto_StakingInfo_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.hedera.hashgraph.sdk.proto.BasicTypes.internal_static_proto_StakingInfo_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.hedera.hashgraph.sdk.proto.StakingInfo.class, com.hedera.hashgraph.sdk.proto.StakingInfo.Builder.class);
}
private int bitField0_;
private int stakedIdCase_ = 0;
@SuppressWarnings("serial")
private java.lang.Object stakedId_;
public enum StakedIdCase
implements com.google.protobuf.Internal.EnumLite,
com.google.protobuf.AbstractMessage.InternalOneOfEnum {
STAKED_ACCOUNT_ID(5),
STAKED_NODE_ID(6),
STAKEDID_NOT_SET(0);
private final int value;
private StakedIdCase(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 StakedIdCase valueOf(int value) {
return forNumber(value);
}
public static StakedIdCase forNumber(int value) {
switch (value) {
case 5: return STAKED_ACCOUNT_ID;
case 6: return STAKED_NODE_ID;
case 0: return STAKEDID_NOT_SET;
default: return null;
}
}
public int getNumber() {
return this.value;
}
};
public StakedIdCase
getStakedIdCase() {
return StakedIdCase.forNumber(
stakedIdCase_);
}
public static final int DECLINE_REWARD_FIELD_NUMBER = 1;
private boolean declineReward_ = false;
/**
*
**
* If true, this account or contract declined to receive a staking reward.
*
*
* bool decline_reward = 1;
* @return The declineReward.
*/
@java.lang.Override
public boolean getDeclineReward() {
return declineReward_;
}
public static final int STAKE_PERIOD_START_FIELD_NUMBER = 2;
private com.hedera.hashgraph.sdk.proto.Timestamp stakePeriodStart_;
/**
*
**
* The staking period during which either the staking settings for this account or contract changed (such as starting
* staking or changing staked_node_id) or the most recent reward was earned, whichever is later. If this account or contract
* is not currently staked to a node, then this field is not set.
*
*
* .proto.Timestamp stake_period_start = 2;
* @return Whether the stakePeriodStart field is set.
*/
@java.lang.Override
public boolean hasStakePeriodStart() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
*
**
* The staking period during which either the staking settings for this account or contract changed (such as starting
* staking or changing staked_node_id) or the most recent reward was earned, whichever is later. If this account or contract
* is not currently staked to a node, then this field is not set.
*
*
* .proto.Timestamp stake_period_start = 2;
* @return The stakePeriodStart.
*/
@java.lang.Override
public com.hedera.hashgraph.sdk.proto.Timestamp getStakePeriodStart() {
return stakePeriodStart_ == null ? com.hedera.hashgraph.sdk.proto.Timestamp.getDefaultInstance() : stakePeriodStart_;
}
/**
*
**
* The staking period during which either the staking settings for this account or contract changed (such as starting
* staking or changing staked_node_id) or the most recent reward was earned, whichever is later. If this account or contract
* is not currently staked to a node, then this field is not set.
*
*
* .proto.Timestamp stake_period_start = 2;
*/
@java.lang.Override
public com.hedera.hashgraph.sdk.proto.TimestampOrBuilder getStakePeriodStartOrBuilder() {
return stakePeriodStart_ == null ? com.hedera.hashgraph.sdk.proto.Timestamp.getDefaultInstance() : stakePeriodStart_;
}
public static final int PENDING_REWARD_FIELD_NUMBER = 3;
private long pendingReward_ = 0L;
/**
*
**
* The amount in tinybars that will be received in the next reward situation.
*
*
* int64 pending_reward = 3;
* @return The pendingReward.
*/
@java.lang.Override
public long getPendingReward() {
return pendingReward_;
}
public static final int STAKED_TO_ME_FIELD_NUMBER = 4;
private long stakedToMe_ = 0L;
/**
*
**
* The total of balance of all accounts staked to this account or contract.
*
*
* int64 staked_to_me = 4;
* @return The stakedToMe.
*/
@java.lang.Override
public long getStakedToMe() {
return stakedToMe_;
}
public static final int STAKED_ACCOUNT_ID_FIELD_NUMBER = 5;
/**
*
**
* The account to which this account or contract is staking.
*
*
* .proto.AccountID staked_account_id = 5;
* @return Whether the stakedAccountId field is set.
*/
@java.lang.Override
public boolean hasStakedAccountId() {
return stakedIdCase_ == 5;
}
/**
*
**
* The account to which this account or contract is staking.
*
*
* .proto.AccountID staked_account_id = 5;
* @return The stakedAccountId.
*/
@java.lang.Override
public com.hedera.hashgraph.sdk.proto.AccountID getStakedAccountId() {
if (stakedIdCase_ == 5) {
return (com.hedera.hashgraph.sdk.proto.AccountID) stakedId_;
}
return com.hedera.hashgraph.sdk.proto.AccountID.getDefaultInstance();
}
/**
*
**
* The account to which this account or contract is staking.
*
*
* .proto.AccountID staked_account_id = 5;
*/
@java.lang.Override
public com.hedera.hashgraph.sdk.proto.AccountIDOrBuilder getStakedAccountIdOrBuilder() {
if (stakedIdCase_ == 5) {
return (com.hedera.hashgraph.sdk.proto.AccountID) stakedId_;
}
return com.hedera.hashgraph.sdk.proto.AccountID.getDefaultInstance();
}
public static final int STAKED_NODE_ID_FIELD_NUMBER = 6;
/**
*
**
* The ID of the node this account or contract is staked to.
*
*
* int64 staked_node_id = 6;
* @return Whether the stakedNodeId field is set.
*/
@java.lang.Override
public boolean hasStakedNodeId() {
return stakedIdCase_ == 6;
}
/**
*
**
* The ID of the node this account or contract is staked to.
*
*
* int64 staked_node_id = 6;
* @return The stakedNodeId.
*/
@java.lang.Override
public long getStakedNodeId() {
if (stakedIdCase_ == 6) {
return (java.lang.Long) stakedId_;
}
return 0L;
}
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 (declineReward_ != false) {
output.writeBool(1, declineReward_);
}
if (((bitField0_ & 0x00000001) != 0)) {
output.writeMessage(2, getStakePeriodStart());
}
if (pendingReward_ != 0L) {
output.writeInt64(3, pendingReward_);
}
if (stakedToMe_ != 0L) {
output.writeInt64(4, stakedToMe_);
}
if (stakedIdCase_ == 5) {
output.writeMessage(5, (com.hedera.hashgraph.sdk.proto.AccountID) stakedId_);
}
if (stakedIdCase_ == 6) {
output.writeInt64(
6, (long)((java.lang.Long) stakedId_));
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (declineReward_ != false) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(1, declineReward_);
}
if (((bitField0_ & 0x00000001) != 0)) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, getStakePeriodStart());
}
if (pendingReward_ != 0L) {
size += com.google.protobuf.CodedOutputStream
.computeInt64Size(3, pendingReward_);
}
if (stakedToMe_ != 0L) {
size += com.google.protobuf.CodedOutputStream
.computeInt64Size(4, stakedToMe_);
}
if (stakedIdCase_ == 5) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(5, (com.hedera.hashgraph.sdk.proto.AccountID) stakedId_);
}
if (stakedIdCase_ == 6) {
size += com.google.protobuf.CodedOutputStream
.computeInt64Size(
6, (long)((java.lang.Long) stakedId_));
}
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.hedera.hashgraph.sdk.proto.StakingInfo)) {
return super.equals(obj);
}
com.hedera.hashgraph.sdk.proto.StakingInfo other = (com.hedera.hashgraph.sdk.proto.StakingInfo) obj;
if (getDeclineReward()
!= other.getDeclineReward()) return false;
if (hasStakePeriodStart() != other.hasStakePeriodStart()) return false;
if (hasStakePeriodStart()) {
if (!getStakePeriodStart()
.equals(other.getStakePeriodStart())) return false;
}
if (getPendingReward()
!= other.getPendingReward()) return false;
if (getStakedToMe()
!= other.getStakedToMe()) return false;
if (!getStakedIdCase().equals(other.getStakedIdCase())) return false;
switch (stakedIdCase_) {
case 5:
if (!getStakedAccountId()
.equals(other.getStakedAccountId())) return false;
break;
case 6:
if (getStakedNodeId()
!= other.getStakedNodeId()) return false;
break;
case 0:
default:
}
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) + DECLINE_REWARD_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
getDeclineReward());
if (hasStakePeriodStart()) {
hash = (37 * hash) + STAKE_PERIOD_START_FIELD_NUMBER;
hash = (53 * hash) + getStakePeriodStart().hashCode();
}
hash = (37 * hash) + PENDING_REWARD_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
getPendingReward());
hash = (37 * hash) + STAKED_TO_ME_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
getStakedToMe());
switch (stakedIdCase_) {
case 5:
hash = (37 * hash) + STAKED_ACCOUNT_ID_FIELD_NUMBER;
hash = (53 * hash) + getStakedAccountId().hashCode();
break;
case 6:
hash = (37 * hash) + STAKED_NODE_ID_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
getStakedNodeId());
break;
case 0:
default:
}
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.hedera.hashgraph.sdk.proto.StakingInfo parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.hedera.hashgraph.sdk.proto.StakingInfo parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.hedera.hashgraph.sdk.proto.StakingInfo parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.hedera.hashgraph.sdk.proto.StakingInfo 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.hashgraph.sdk.proto.StakingInfo parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.hedera.hashgraph.sdk.proto.StakingInfo parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.hedera.hashgraph.sdk.proto.StakingInfo parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.hedera.hashgraph.sdk.proto.StakingInfo 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.hashgraph.sdk.proto.StakingInfo parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static com.hedera.hashgraph.sdk.proto.StakingInfo 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.hashgraph.sdk.proto.StakingInfo parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.hedera.hashgraph.sdk.proto.StakingInfo 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.hashgraph.sdk.proto.StakingInfo 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;
}
/**
*
**
* Staking metadata for an account or a contract returned in CryptoGetInfo or ContractGetInfo queries
*
*
* Protobuf type {@code proto.StakingInfo}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:proto.StakingInfo)
com.hedera.hashgraph.sdk.proto.StakingInfoOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.hedera.hashgraph.sdk.proto.BasicTypes.internal_static_proto_StakingInfo_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.hedera.hashgraph.sdk.proto.BasicTypes.internal_static_proto_StakingInfo_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.hedera.hashgraph.sdk.proto.StakingInfo.class, com.hedera.hashgraph.sdk.proto.StakingInfo.Builder.class);
}
// Construct using com.hedera.hashgraph.sdk.proto.StakingInfo.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
getStakePeriodStartFieldBuilder();
}
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
declineReward_ = false;
stakePeriodStart_ = null;
if (stakePeriodStartBuilder_ != null) {
stakePeriodStartBuilder_.dispose();
stakePeriodStartBuilder_ = null;
}
pendingReward_ = 0L;
stakedToMe_ = 0L;
if (stakedAccountIdBuilder_ != null) {
stakedAccountIdBuilder_.clear();
}
stakedIdCase_ = 0;
stakedId_ = null;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.hedera.hashgraph.sdk.proto.BasicTypes.internal_static_proto_StakingInfo_descriptor;
}
@java.lang.Override
public com.hedera.hashgraph.sdk.proto.StakingInfo getDefaultInstanceForType() {
return com.hedera.hashgraph.sdk.proto.StakingInfo.getDefaultInstance();
}
@java.lang.Override
public com.hedera.hashgraph.sdk.proto.StakingInfo build() {
com.hedera.hashgraph.sdk.proto.StakingInfo result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.hedera.hashgraph.sdk.proto.StakingInfo buildPartial() {
com.hedera.hashgraph.sdk.proto.StakingInfo result = new com.hedera.hashgraph.sdk.proto.StakingInfo(this);
if (bitField0_ != 0) { buildPartial0(result); }
buildPartialOneofs(result);
onBuilt();
return result;
}
private void buildPartial0(com.hedera.hashgraph.sdk.proto.StakingInfo result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.declineReward_ = declineReward_;
}
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000002) != 0)) {
result.stakePeriodStart_ = stakePeriodStartBuilder_ == null
? stakePeriodStart_
: stakePeriodStartBuilder_.build();
to_bitField0_ |= 0x00000001;
}
if (((from_bitField0_ & 0x00000004) != 0)) {
result.pendingReward_ = pendingReward_;
}
if (((from_bitField0_ & 0x00000008) != 0)) {
result.stakedToMe_ = stakedToMe_;
}
result.bitField0_ |= to_bitField0_;
}
private void buildPartialOneofs(com.hedera.hashgraph.sdk.proto.StakingInfo result) {
result.stakedIdCase_ = stakedIdCase_;
result.stakedId_ = this.stakedId_;
if (stakedIdCase_ == 5 &&
stakedAccountIdBuilder_ != null) {
result.stakedId_ = stakedAccountIdBuilder_.build();
}
}
@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.hashgraph.sdk.proto.StakingInfo) {
return mergeFrom((com.hedera.hashgraph.sdk.proto.StakingInfo)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.hedera.hashgraph.sdk.proto.StakingInfo other) {
if (other == com.hedera.hashgraph.sdk.proto.StakingInfo.getDefaultInstance()) return this;
if (other.getDeclineReward() != false) {
setDeclineReward(other.getDeclineReward());
}
if (other.hasStakePeriodStart()) {
mergeStakePeriodStart(other.getStakePeriodStart());
}
if (other.getPendingReward() != 0L) {
setPendingReward(other.getPendingReward());
}
if (other.getStakedToMe() != 0L) {
setStakedToMe(other.getStakedToMe());
}
switch (other.getStakedIdCase()) {
case STAKED_ACCOUNT_ID: {
mergeStakedAccountId(other.getStakedAccountId());
break;
}
case STAKED_NODE_ID: {
setStakedNodeId(other.getStakedNodeId());
break;
}
case STAKEDID_NOT_SET: {
break;
}
}
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 8: {
declineReward_ = input.readBool();
bitField0_ |= 0x00000001;
break;
} // case 8
case 18: {
input.readMessage(
getStakePeriodStartFieldBuilder().getBuilder(),
extensionRegistry);
bitField0_ |= 0x00000002;
break;
} // case 18
case 24: {
pendingReward_ = input.readInt64();
bitField0_ |= 0x00000004;
break;
} // case 24
case 32: {
stakedToMe_ = input.readInt64();
bitField0_ |= 0x00000008;
break;
} // case 32
case 42: {
input.readMessage(
getStakedAccountIdFieldBuilder().getBuilder(),
extensionRegistry);
stakedIdCase_ = 5;
break;
} // case 42
case 48: {
stakedId_ = input.readInt64();
stakedIdCase_ = 6;
break;
} // case 48
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 int stakedIdCase_ = 0;
private java.lang.Object stakedId_;
public StakedIdCase
getStakedIdCase() {
return StakedIdCase.forNumber(
stakedIdCase_);
}
public Builder clearStakedId() {
stakedIdCase_ = 0;
stakedId_ = null;
onChanged();
return this;
}
private int bitField0_;
private boolean declineReward_ ;
/**
*
**
* If true, this account or contract declined to receive a staking reward.
*
*
* bool decline_reward = 1;
* @return The declineReward.
*/
@java.lang.Override
public boolean getDeclineReward() {
return declineReward_;
}
/**
*
**
* If true, this account or contract declined to receive a staking reward.
*
*
* bool decline_reward = 1;
* @param value The declineReward to set.
* @return This builder for chaining.
*/
public Builder setDeclineReward(boolean value) {
declineReward_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
*
**
* If true, this account or contract declined to receive a staking reward.
*
*
* bool decline_reward = 1;
* @return This builder for chaining.
*/
public Builder clearDeclineReward() {
bitField0_ = (bitField0_ & ~0x00000001);
declineReward_ = false;
onChanged();
return this;
}
private com.hedera.hashgraph.sdk.proto.Timestamp stakePeriodStart_;
private com.google.protobuf.SingleFieldBuilderV3<
com.hedera.hashgraph.sdk.proto.Timestamp, com.hedera.hashgraph.sdk.proto.Timestamp.Builder, com.hedera.hashgraph.sdk.proto.TimestampOrBuilder> stakePeriodStartBuilder_;
/**
*
**
* The staking period during which either the staking settings for this account or contract changed (such as starting
* staking or changing staked_node_id) or the most recent reward was earned, whichever is later. If this account or contract
* is not currently staked to a node, then this field is not set.
*
*
* .proto.Timestamp stake_period_start = 2;
* @return Whether the stakePeriodStart field is set.
*/
public boolean hasStakePeriodStart() {
return ((bitField0_ & 0x00000002) != 0);
}
/**
*
**
* The staking period during which either the staking settings for this account or contract changed (such as starting
* staking or changing staked_node_id) or the most recent reward was earned, whichever is later. If this account or contract
* is not currently staked to a node, then this field is not set.
*
*
* .proto.Timestamp stake_period_start = 2;
* @return The stakePeriodStart.
*/
public com.hedera.hashgraph.sdk.proto.Timestamp getStakePeriodStart() {
if (stakePeriodStartBuilder_ == null) {
return stakePeriodStart_ == null ? com.hedera.hashgraph.sdk.proto.Timestamp.getDefaultInstance() : stakePeriodStart_;
} else {
return stakePeriodStartBuilder_.getMessage();
}
}
/**
*
**
* The staking period during which either the staking settings for this account or contract changed (such as starting
* staking or changing staked_node_id) or the most recent reward was earned, whichever is later. If this account or contract
* is not currently staked to a node, then this field is not set.
*
*
* .proto.Timestamp stake_period_start = 2;
*/
public Builder setStakePeriodStart(com.hedera.hashgraph.sdk.proto.Timestamp value) {
if (stakePeriodStartBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
stakePeriodStart_ = value;
} else {
stakePeriodStartBuilder_.setMessage(value);
}
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
*
**
* The staking period during which either the staking settings for this account or contract changed (such as starting
* staking or changing staked_node_id) or the most recent reward was earned, whichever is later. If this account or contract
* is not currently staked to a node, then this field is not set.
*
*
* .proto.Timestamp stake_period_start = 2;
*/
public Builder setStakePeriodStart(
com.hedera.hashgraph.sdk.proto.Timestamp.Builder builderForValue) {
if (stakePeriodStartBuilder_ == null) {
stakePeriodStart_ = builderForValue.build();
} else {
stakePeriodStartBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
*
**
* The staking period during which either the staking settings for this account or contract changed (such as starting
* staking or changing staked_node_id) or the most recent reward was earned, whichever is later. If this account or contract
* is not currently staked to a node, then this field is not set.
*
*
* .proto.Timestamp stake_period_start = 2;
*/
public Builder mergeStakePeriodStart(com.hedera.hashgraph.sdk.proto.Timestamp value) {
if (stakePeriodStartBuilder_ == null) {
if (((bitField0_ & 0x00000002) != 0) &&
stakePeriodStart_ != null &&
stakePeriodStart_ != com.hedera.hashgraph.sdk.proto.Timestamp.getDefaultInstance()) {
getStakePeriodStartBuilder().mergeFrom(value);
} else {
stakePeriodStart_ = value;
}
} else {
stakePeriodStartBuilder_.mergeFrom(value);
}
if (stakePeriodStart_ != null) {
bitField0_ |= 0x00000002;
onChanged();
}
return this;
}
/**
*
**
* The staking period during which either the staking settings for this account or contract changed (such as starting
* staking or changing staked_node_id) or the most recent reward was earned, whichever is later. If this account or contract
* is not currently staked to a node, then this field is not set.
*
*
* .proto.Timestamp stake_period_start = 2;
*/
public Builder clearStakePeriodStart() {
bitField0_ = (bitField0_ & ~0x00000002);
stakePeriodStart_ = null;
if (stakePeriodStartBuilder_ != null) {
stakePeriodStartBuilder_.dispose();
stakePeriodStartBuilder_ = null;
}
onChanged();
return this;
}
/**
*
**
* The staking period during which either the staking settings for this account or contract changed (such as starting
* staking or changing staked_node_id) or the most recent reward was earned, whichever is later. If this account or contract
* is not currently staked to a node, then this field is not set.
*
*
* .proto.Timestamp stake_period_start = 2;
*/
public com.hedera.hashgraph.sdk.proto.Timestamp.Builder getStakePeriodStartBuilder() {
bitField0_ |= 0x00000002;
onChanged();
return getStakePeriodStartFieldBuilder().getBuilder();
}
/**
*
**
* The staking period during which either the staking settings for this account or contract changed (such as starting
* staking or changing staked_node_id) or the most recent reward was earned, whichever is later. If this account or contract
* is not currently staked to a node, then this field is not set.
*
*
* .proto.Timestamp stake_period_start = 2;
*/
public com.hedera.hashgraph.sdk.proto.TimestampOrBuilder getStakePeriodStartOrBuilder() {
if (stakePeriodStartBuilder_ != null) {
return stakePeriodStartBuilder_.getMessageOrBuilder();
} else {
return stakePeriodStart_ == null ?
com.hedera.hashgraph.sdk.proto.Timestamp.getDefaultInstance() : stakePeriodStart_;
}
}
/**
*
**
* The staking period during which either the staking settings for this account or contract changed (such as starting
* staking or changing staked_node_id) or the most recent reward was earned, whichever is later. If this account or contract
* is not currently staked to a node, then this field is not set.
*
*
* .proto.Timestamp stake_period_start = 2;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.hedera.hashgraph.sdk.proto.Timestamp, com.hedera.hashgraph.sdk.proto.Timestamp.Builder, com.hedera.hashgraph.sdk.proto.TimestampOrBuilder>
getStakePeriodStartFieldBuilder() {
if (stakePeriodStartBuilder_ == null) {
stakePeriodStartBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
com.hedera.hashgraph.sdk.proto.Timestamp, com.hedera.hashgraph.sdk.proto.Timestamp.Builder, com.hedera.hashgraph.sdk.proto.TimestampOrBuilder>(
getStakePeriodStart(),
getParentForChildren(),
isClean());
stakePeriodStart_ = null;
}
return stakePeriodStartBuilder_;
}
private long pendingReward_ ;
/**
*
**
* The amount in tinybars that will be received in the next reward situation.
*
*
* int64 pending_reward = 3;
* @return The pendingReward.
*/
@java.lang.Override
public long getPendingReward() {
return pendingReward_;
}
/**
*
**
* The amount in tinybars that will be received in the next reward situation.
*
*
* int64 pending_reward = 3;
* @param value The pendingReward to set.
* @return This builder for chaining.
*/
public Builder setPendingReward(long value) {
pendingReward_ = value;
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
*
**
* The amount in tinybars that will be received in the next reward situation.
*
*
* int64 pending_reward = 3;
* @return This builder for chaining.
*/
public Builder clearPendingReward() {
bitField0_ = (bitField0_ & ~0x00000004);
pendingReward_ = 0L;
onChanged();
return this;
}
private long stakedToMe_ ;
/**
*
**
* The total of balance of all accounts staked to this account or contract.
*
*
* int64 staked_to_me = 4;
* @return The stakedToMe.
*/
@java.lang.Override
public long getStakedToMe() {
return stakedToMe_;
}
/**
*
**
* The total of balance of all accounts staked to this account or contract.
*
*
* int64 staked_to_me = 4;
* @param value The stakedToMe to set.
* @return This builder for chaining.
*/
public Builder setStakedToMe(long value) {
stakedToMe_ = value;
bitField0_ |= 0x00000008;
onChanged();
return this;
}
/**
*
**
* The total of balance of all accounts staked to this account or contract.
*
*
* int64 staked_to_me = 4;
* @return This builder for chaining.
*/
public Builder clearStakedToMe() {
bitField0_ = (bitField0_ & ~0x00000008);
stakedToMe_ = 0L;
onChanged();
return this;
}
private com.google.protobuf.SingleFieldBuilderV3<
com.hedera.hashgraph.sdk.proto.AccountID, com.hedera.hashgraph.sdk.proto.AccountID.Builder, com.hedera.hashgraph.sdk.proto.AccountIDOrBuilder> stakedAccountIdBuilder_;
/**
*
**
* The account to which this account or contract is staking.
*
*
* .proto.AccountID staked_account_id = 5;
* @return Whether the stakedAccountId field is set.
*/
@java.lang.Override
public boolean hasStakedAccountId() {
return stakedIdCase_ == 5;
}
/**
*
**
* The account to which this account or contract is staking.
*
*
* .proto.AccountID staked_account_id = 5;
* @return The stakedAccountId.
*/
@java.lang.Override
public com.hedera.hashgraph.sdk.proto.AccountID getStakedAccountId() {
if (stakedAccountIdBuilder_ == null) {
if (stakedIdCase_ == 5) {
return (com.hedera.hashgraph.sdk.proto.AccountID) stakedId_;
}
return com.hedera.hashgraph.sdk.proto.AccountID.getDefaultInstance();
} else {
if (stakedIdCase_ == 5) {
return stakedAccountIdBuilder_.getMessage();
}
return com.hedera.hashgraph.sdk.proto.AccountID.getDefaultInstance();
}
}
/**
*
**
* The account to which this account or contract is staking.
*
*
* .proto.AccountID staked_account_id = 5;
*/
public Builder setStakedAccountId(com.hedera.hashgraph.sdk.proto.AccountID value) {
if (stakedAccountIdBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
stakedId_ = value;
onChanged();
} else {
stakedAccountIdBuilder_.setMessage(value);
}
stakedIdCase_ = 5;
return this;
}
/**
*
**
* The account to which this account or contract is staking.
*
*
* .proto.AccountID staked_account_id = 5;
*/
public Builder setStakedAccountId(
com.hedera.hashgraph.sdk.proto.AccountID.Builder builderForValue) {
if (stakedAccountIdBuilder_ == null) {
stakedId_ = builderForValue.build();
onChanged();
} else {
stakedAccountIdBuilder_.setMessage(builderForValue.build());
}
stakedIdCase_ = 5;
return this;
}
/**
*
**
* The account to which this account or contract is staking.
*
*
* .proto.AccountID staked_account_id = 5;
*/
public Builder mergeStakedAccountId(com.hedera.hashgraph.sdk.proto.AccountID value) {
if (stakedAccountIdBuilder_ == null) {
if (stakedIdCase_ == 5 &&
stakedId_ != com.hedera.hashgraph.sdk.proto.AccountID.getDefaultInstance()) {
stakedId_ = com.hedera.hashgraph.sdk.proto.AccountID.newBuilder((com.hedera.hashgraph.sdk.proto.AccountID) stakedId_)
.mergeFrom(value).buildPartial();
} else {
stakedId_ = value;
}
onChanged();
} else {
if (stakedIdCase_ == 5) {
stakedAccountIdBuilder_.mergeFrom(value);
} else {
stakedAccountIdBuilder_.setMessage(value);
}
}
stakedIdCase_ = 5;
return this;
}
/**
*
**
* The account to which this account or contract is staking.
*
*
* .proto.AccountID staked_account_id = 5;
*/
public Builder clearStakedAccountId() {
if (stakedAccountIdBuilder_ == null) {
if (stakedIdCase_ == 5) {
stakedIdCase_ = 0;
stakedId_ = null;
onChanged();
}
} else {
if (stakedIdCase_ == 5) {
stakedIdCase_ = 0;
stakedId_ = null;
}
stakedAccountIdBuilder_.clear();
}
return this;
}
/**
*
**
* The account to which this account or contract is staking.
*
*
* .proto.AccountID staked_account_id = 5;
*/
public com.hedera.hashgraph.sdk.proto.AccountID.Builder getStakedAccountIdBuilder() {
return getStakedAccountIdFieldBuilder().getBuilder();
}
/**
*
**
* The account to which this account or contract is staking.
*
*
* .proto.AccountID staked_account_id = 5;
*/
@java.lang.Override
public com.hedera.hashgraph.sdk.proto.AccountIDOrBuilder getStakedAccountIdOrBuilder() {
if ((stakedIdCase_ == 5) && (stakedAccountIdBuilder_ != null)) {
return stakedAccountIdBuilder_.getMessageOrBuilder();
} else {
if (stakedIdCase_ == 5) {
return (com.hedera.hashgraph.sdk.proto.AccountID) stakedId_;
}
return com.hedera.hashgraph.sdk.proto.AccountID.getDefaultInstance();
}
}
/**
*
**
* The account to which this account or contract is staking.
*
*
* .proto.AccountID staked_account_id = 5;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.hedera.hashgraph.sdk.proto.AccountID, com.hedera.hashgraph.sdk.proto.AccountID.Builder, com.hedera.hashgraph.sdk.proto.AccountIDOrBuilder>
getStakedAccountIdFieldBuilder() {
if (stakedAccountIdBuilder_ == null) {
if (!(stakedIdCase_ == 5)) {
stakedId_ = com.hedera.hashgraph.sdk.proto.AccountID.getDefaultInstance();
}
stakedAccountIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
com.hedera.hashgraph.sdk.proto.AccountID, com.hedera.hashgraph.sdk.proto.AccountID.Builder, com.hedera.hashgraph.sdk.proto.AccountIDOrBuilder>(
(com.hedera.hashgraph.sdk.proto.AccountID) stakedId_,
getParentForChildren(),
isClean());
stakedId_ = null;
}
stakedIdCase_ = 5;
onChanged();
return stakedAccountIdBuilder_;
}
/**
*
**
* The ID of the node this account or contract is staked to.
*
*
* int64 staked_node_id = 6;
* @return Whether the stakedNodeId field is set.
*/
public boolean hasStakedNodeId() {
return stakedIdCase_ == 6;
}
/**
*
**
* The ID of the node this account or contract is staked to.
*
*
* int64 staked_node_id = 6;
* @return The stakedNodeId.
*/
public long getStakedNodeId() {
if (stakedIdCase_ == 6) {
return (java.lang.Long) stakedId_;
}
return 0L;
}
/**
*
**
* The ID of the node this account or contract is staked to.
*
*
* int64 staked_node_id = 6;
* @param value The stakedNodeId to set.
* @return This builder for chaining.
*/
public Builder setStakedNodeId(long value) {
stakedIdCase_ = 6;
stakedId_ = value;
onChanged();
return this;
}
/**
*
**
* The ID of the node this account or contract is staked to.
*
*
* int64 staked_node_id = 6;
* @return This builder for chaining.
*/
public Builder clearStakedNodeId() {
if (stakedIdCase_ == 6) {
stakedIdCase_ = 0;
stakedId_ = 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:proto.StakingInfo)
}
// @@protoc_insertion_point(class_scope:proto.StakingInfo)
private static final com.hedera.hashgraph.sdk.proto.StakingInfo DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.hedera.hashgraph.sdk.proto.StakingInfo();
}
public static com.hedera.hashgraph.sdk.proto.StakingInfo getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public StakingInfo 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 parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public com.hedera.hashgraph.sdk.proto.StakingInfo getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}