com.hedera.hashgraph.sdk.proto.StakingNodeInfo 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: staking_node_info.proto
// Protobuf Java Version: 3.25.3
package com.hedera.hashgraph.sdk.proto;
/**
*
**
* Representation of a Hedera Token Service staking info entity in the network Merkle tree.
*
* As with all network entities, staking info is per node and has a unique entity number represented as shard.realm.X.
*
*
* Protobuf type {@code proto.StakingNodeInfo}
*/
public final class StakingNodeInfo extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:proto.StakingNodeInfo)
StakingNodeInfoOrBuilder {
private static final long serialVersionUID = 0L;
// Use StakingNodeInfo.newBuilder() to construct.
private StakingNodeInfo(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private StakingNodeInfo() {
rewardSumHistory_ = emptyLongList();
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new StakingNodeInfo();
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.hedera.hashgraph.sdk.proto.StakingNodeInfoOuterClass.internal_static_proto_StakingNodeInfo_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.hedera.hashgraph.sdk.proto.StakingNodeInfoOuterClass.internal_static_proto_StakingNodeInfo_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.hedera.hashgraph.sdk.proto.StakingNodeInfo.class, com.hedera.hashgraph.sdk.proto.StakingNodeInfo.Builder.class);
}
public static final int NODE_NUMBER_FIELD_NUMBER = 1;
private long nodeNumber_ = 0L;
/**
*
**
* The unique entity number of the node. The shard and realm numbers are implied, based on the network
* this entity came from.
*
*
* int64 node_number = 1;
* @return The nodeNumber.
*/
@java.lang.Override
public long getNodeNumber() {
return nodeNumber_;
}
public static final int MIN_STAKE_FIELD_NUMBER = 2;
private long minStake_ = 0L;
/**
*
**
* The minimum stake on this node that is required for this node to have a non-zero weight to
* participate in the network consensus.
*
*
* int64 min_stake = 2;
* @return The minStake.
*/
@java.lang.Override
public long getMinStake() {
return minStake_;
}
public static final int MAX_STAKE_FIELD_NUMBER = 3;
private long maxStake_ = 0L;
/**
*
**
* The maximum stake on this node that is considered to calculate its weight to participate in the network consensus.
*
*
* int64 max_stake = 3;
* @return The maxStake.
*/
@java.lang.Override
public long getMaxStake() {
return maxStake_;
}
public static final int STAKE_TO_REWARD_FIELD_NUMBER = 4;
private long stakeToReward_ = 0L;
/**
*
**
* The sum of balances of all accounts staked to this node who have opted to receive rewards.
*
*
* int64 stake_to_reward = 4;
* @return The stakeToReward.
*/
@java.lang.Override
public long getStakeToReward() {
return stakeToReward_;
}
public static final int STAKE_TO_NOT_REWARD_FIELD_NUMBER = 5;
private long stakeToNotReward_ = 0L;
/**
*
**
* The sum of balances of all accounts staked to this node who have opted to decline rewards.
*
*
* int64 stake_to_not_reward = 5;
* @return The stakeToNotReward.
*/
@java.lang.Override
public long getStakeToNotReward() {
return stakeToNotReward_;
}
public static final int STAKE_REWARD_START_FIELD_NUMBER = 6;
private long stakeRewardStart_ = 0L;
/**
*
**
* The snapshot of stake_to_reward value at the beginning of the current staking period.
* This is needed for calculating rewards for current staking period without considering changes to
* stake_to_reward in the current staking period. It is reset at the beginning of every period.
*
*
* int64 stake_reward_start = 6;
* @return The stakeRewardStart.
*/
@java.lang.Override
public long getStakeRewardStart() {
return stakeRewardStart_;
}
public static final int UNCLAIMED_STAKE_REWARD_START_FIELD_NUMBER = 7;
private long unclaimedStakeRewardStart_ = 0L;
/**
*
**
* Tracks how much stake from stakeRewardStart will have unclaimed rewards due to accounts changing their staking
* metadata in a way that disqualifies them for the current period; It is reset at the beginning of every period
*
*
* int64 unclaimed_stake_reward_start = 7;
* @return The unclaimedStakeRewardStart.
*/
@java.lang.Override
public long getUnclaimedStakeRewardStart() {
return unclaimedStakeRewardStart_;
}
public static final int STAKE_FIELD_NUMBER = 8;
private long stake_ = 0L;
/**
*
**
* The total amount of effective hbar staked to this node. This is sum of stake_to_reward and stake_to_not_reward.
* If the sum is greater than max_stake, then the effective stake is max_stake.
* If the sum is less than min_stake, then the effective stake is 0.
*
*
* int64 stake = 8;
* @return The stake.
*/
@java.lang.Override
public long getStake() {
return stake_;
}
public static final int REWARD_SUM_HISTORY_FIELD_NUMBER = 9;
@SuppressWarnings("serial")
private com.google.protobuf.Internal.LongList rewardSumHistory_ =
emptyLongList();
/**
*
**
* An running sum of reward rates per hbar for the last 365+1 staking periods. The first element is the
* is the reward up to and including the last full period that finished before the present. Second element is
* the reward up to and including the period before that
*
*
* repeated int64 reward_sum_history = 9;
* @return A list containing the rewardSumHistory.
*/
@java.lang.Override
public java.util.List
getRewardSumHistoryList() {
return rewardSumHistory_;
}
/**
*
**
* An running sum of reward rates per hbar for the last 365+1 staking periods. The first element is the
* is the reward up to and including the last full period that finished before the present. Second element is
* the reward up to and including the period before that
*
*
* repeated int64 reward_sum_history = 9;
* @return The count of rewardSumHistory.
*/
public int getRewardSumHistoryCount() {
return rewardSumHistory_.size();
}
/**
*
**
* An running sum of reward rates per hbar for the last 365+1 staking periods. The first element is the
* is the reward up to and including the last full period that finished before the present. Second element is
* the reward up to and including the period before that
*
*
* repeated int64 reward_sum_history = 9;
* @param index The index of the element to return.
* @return The rewardSumHistory at the given index.
*/
public long getRewardSumHistory(int index) {
return rewardSumHistory_.getLong(index);
}
private int rewardSumHistoryMemoizedSerializedSize = -1;
public static final int WEIGHT_FIELD_NUMBER = 10;
private int weight_ = 0;
/**
*
**
* The consensus weight of this node in the network. This is computed based on the stake of this node
* at midnight UTC of the current day. If the stake of this node is less than minStake, then the weight is 0.
* Sum of all weights of nodes in the network should be less than 500.
* If the stake of this node A is greater than minStake, then the weight of this node A is calculated as:
* (node A stake * 500/ total stake of all nodes)
*
*
* int32 weight = 10;
* @return The weight.
*/
@java.lang.Override
public int getWeight() {
return weight_;
}
public static final int PENDING_REWARDS_FIELD_NUMBER = 11;
private long pendingRewards_ = 0L;
/**
*
**
* The total staking rewards in tinybars that COULD be collected by all accounts staking to the current node after the end
* of this staking period; assuming that no account "renounces" its rewards by, for example, setting declineReward=true.
* When the current node is deleted, this amount will be subtracted from the total pending rewards of all accounts staking
* to all nodes in the network in NetworkStakingRewards.
*
*
* int64 pending_rewards = 11;
* @return The pendingRewards.
*/
@java.lang.Override
public long getPendingRewards() {
return pendingRewards_;
}
public static final int DELETED_FIELD_NUMBER = 12;
private boolean deleted_ = false;
/**
*
**
* True if this node has been deleted from network.
*
*
* bool deleted = 12;
* @return The deleted.
*/
@java.lang.Override
public boolean getDeleted() {
return deleted_;
}
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 {
getSerializedSize();
if (nodeNumber_ != 0L) {
output.writeInt64(1, nodeNumber_);
}
if (minStake_ != 0L) {
output.writeInt64(2, minStake_);
}
if (maxStake_ != 0L) {
output.writeInt64(3, maxStake_);
}
if (stakeToReward_ != 0L) {
output.writeInt64(4, stakeToReward_);
}
if (stakeToNotReward_ != 0L) {
output.writeInt64(5, stakeToNotReward_);
}
if (stakeRewardStart_ != 0L) {
output.writeInt64(6, stakeRewardStart_);
}
if (unclaimedStakeRewardStart_ != 0L) {
output.writeInt64(7, unclaimedStakeRewardStart_);
}
if (stake_ != 0L) {
output.writeInt64(8, stake_);
}
if (getRewardSumHistoryList().size() > 0) {
output.writeUInt32NoTag(74);
output.writeUInt32NoTag(rewardSumHistoryMemoizedSerializedSize);
}
for (int i = 0; i < rewardSumHistory_.size(); i++) {
output.writeInt64NoTag(rewardSumHistory_.getLong(i));
}
if (weight_ != 0) {
output.writeInt32(10, weight_);
}
if (pendingRewards_ != 0L) {
output.writeInt64(11, pendingRewards_);
}
if (deleted_ != false) {
output.writeBool(12, deleted_);
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (nodeNumber_ != 0L) {
size += com.google.protobuf.CodedOutputStream
.computeInt64Size(1, nodeNumber_);
}
if (minStake_ != 0L) {
size += com.google.protobuf.CodedOutputStream
.computeInt64Size(2, minStake_);
}
if (maxStake_ != 0L) {
size += com.google.protobuf.CodedOutputStream
.computeInt64Size(3, maxStake_);
}
if (stakeToReward_ != 0L) {
size += com.google.protobuf.CodedOutputStream
.computeInt64Size(4, stakeToReward_);
}
if (stakeToNotReward_ != 0L) {
size += com.google.protobuf.CodedOutputStream
.computeInt64Size(5, stakeToNotReward_);
}
if (stakeRewardStart_ != 0L) {
size += com.google.protobuf.CodedOutputStream
.computeInt64Size(6, stakeRewardStart_);
}
if (unclaimedStakeRewardStart_ != 0L) {
size += com.google.protobuf.CodedOutputStream
.computeInt64Size(7, unclaimedStakeRewardStart_);
}
if (stake_ != 0L) {
size += com.google.protobuf.CodedOutputStream
.computeInt64Size(8, stake_);
}
{
int dataSize = 0;
for (int i = 0; i < rewardSumHistory_.size(); i++) {
dataSize += com.google.protobuf.CodedOutputStream
.computeInt64SizeNoTag(rewardSumHistory_.getLong(i));
}
size += dataSize;
if (!getRewardSumHistoryList().isEmpty()) {
size += 1;
size += com.google.protobuf.CodedOutputStream
.computeInt32SizeNoTag(dataSize);
}
rewardSumHistoryMemoizedSerializedSize = dataSize;
}
if (weight_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(10, weight_);
}
if (pendingRewards_ != 0L) {
size += com.google.protobuf.CodedOutputStream
.computeInt64Size(11, pendingRewards_);
}
if (deleted_ != false) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(12, deleted_);
}
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.StakingNodeInfo)) {
return super.equals(obj);
}
com.hedera.hashgraph.sdk.proto.StakingNodeInfo other = (com.hedera.hashgraph.sdk.proto.StakingNodeInfo) obj;
if (getNodeNumber()
!= other.getNodeNumber()) return false;
if (getMinStake()
!= other.getMinStake()) return false;
if (getMaxStake()
!= other.getMaxStake()) return false;
if (getStakeToReward()
!= other.getStakeToReward()) return false;
if (getStakeToNotReward()
!= other.getStakeToNotReward()) return false;
if (getStakeRewardStart()
!= other.getStakeRewardStart()) return false;
if (getUnclaimedStakeRewardStart()
!= other.getUnclaimedStakeRewardStart()) return false;
if (getStake()
!= other.getStake()) return false;
if (!getRewardSumHistoryList()
.equals(other.getRewardSumHistoryList())) return false;
if (getWeight()
!= other.getWeight()) return false;
if (getPendingRewards()
!= other.getPendingRewards()) return false;
if (getDeleted()
!= other.getDeleted()) 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) + NODE_NUMBER_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
getNodeNumber());
hash = (37 * hash) + MIN_STAKE_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
getMinStake());
hash = (37 * hash) + MAX_STAKE_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
getMaxStake());
hash = (37 * hash) + STAKE_TO_REWARD_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
getStakeToReward());
hash = (37 * hash) + STAKE_TO_NOT_REWARD_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
getStakeToNotReward());
hash = (37 * hash) + STAKE_REWARD_START_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
getStakeRewardStart());
hash = (37 * hash) + UNCLAIMED_STAKE_REWARD_START_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
getUnclaimedStakeRewardStart());
hash = (37 * hash) + STAKE_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
getStake());
if (getRewardSumHistoryCount() > 0) {
hash = (37 * hash) + REWARD_SUM_HISTORY_FIELD_NUMBER;
hash = (53 * hash) + getRewardSumHistoryList().hashCode();
}
hash = (37 * hash) + WEIGHT_FIELD_NUMBER;
hash = (53 * hash) + getWeight();
hash = (37 * hash) + PENDING_REWARDS_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
getPendingRewards());
hash = (37 * hash) + DELETED_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
getDeleted());
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.hedera.hashgraph.sdk.proto.StakingNodeInfo parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.hedera.hashgraph.sdk.proto.StakingNodeInfo 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.StakingNodeInfo parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.hedera.hashgraph.sdk.proto.StakingNodeInfo 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.StakingNodeInfo parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.hedera.hashgraph.sdk.proto.StakingNodeInfo 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.StakingNodeInfo parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.hedera.hashgraph.sdk.proto.StakingNodeInfo 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.StakingNodeInfo parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static com.hedera.hashgraph.sdk.proto.StakingNodeInfo 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.StakingNodeInfo 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.StakingNodeInfo 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.StakingNodeInfo 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;
}
/**
*
**
* Representation of a Hedera Token Service staking info entity in the network Merkle tree.
*
* As with all network entities, staking info is per node and has a unique entity number represented as shard.realm.X.
*
*
* Protobuf type {@code proto.StakingNodeInfo}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:proto.StakingNodeInfo)
com.hedera.hashgraph.sdk.proto.StakingNodeInfoOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.hedera.hashgraph.sdk.proto.StakingNodeInfoOuterClass.internal_static_proto_StakingNodeInfo_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.hedera.hashgraph.sdk.proto.StakingNodeInfoOuterClass.internal_static_proto_StakingNodeInfo_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.hedera.hashgraph.sdk.proto.StakingNodeInfo.class, com.hedera.hashgraph.sdk.proto.StakingNodeInfo.Builder.class);
}
// Construct using com.hedera.hashgraph.sdk.proto.StakingNodeInfo.newBuilder()
private Builder() {
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
nodeNumber_ = 0L;
minStake_ = 0L;
maxStake_ = 0L;
stakeToReward_ = 0L;
stakeToNotReward_ = 0L;
stakeRewardStart_ = 0L;
unclaimedStakeRewardStart_ = 0L;
stake_ = 0L;
rewardSumHistory_ = emptyLongList();
weight_ = 0;
pendingRewards_ = 0L;
deleted_ = false;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.hedera.hashgraph.sdk.proto.StakingNodeInfoOuterClass.internal_static_proto_StakingNodeInfo_descriptor;
}
@java.lang.Override
public com.hedera.hashgraph.sdk.proto.StakingNodeInfo getDefaultInstanceForType() {
return com.hedera.hashgraph.sdk.proto.StakingNodeInfo.getDefaultInstance();
}
@java.lang.Override
public com.hedera.hashgraph.sdk.proto.StakingNodeInfo build() {
com.hedera.hashgraph.sdk.proto.StakingNodeInfo result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.hedera.hashgraph.sdk.proto.StakingNodeInfo buildPartial() {
com.hedera.hashgraph.sdk.proto.StakingNodeInfo result = new com.hedera.hashgraph.sdk.proto.StakingNodeInfo(this);
if (bitField0_ != 0) { buildPartial0(result); }
onBuilt();
return result;
}
private void buildPartial0(com.hedera.hashgraph.sdk.proto.StakingNodeInfo result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.nodeNumber_ = nodeNumber_;
}
if (((from_bitField0_ & 0x00000002) != 0)) {
result.minStake_ = minStake_;
}
if (((from_bitField0_ & 0x00000004) != 0)) {
result.maxStake_ = maxStake_;
}
if (((from_bitField0_ & 0x00000008) != 0)) {
result.stakeToReward_ = stakeToReward_;
}
if (((from_bitField0_ & 0x00000010) != 0)) {
result.stakeToNotReward_ = stakeToNotReward_;
}
if (((from_bitField0_ & 0x00000020) != 0)) {
result.stakeRewardStart_ = stakeRewardStart_;
}
if (((from_bitField0_ & 0x00000040) != 0)) {
result.unclaimedStakeRewardStart_ = unclaimedStakeRewardStart_;
}
if (((from_bitField0_ & 0x00000080) != 0)) {
result.stake_ = stake_;
}
if (((from_bitField0_ & 0x00000100) != 0)) {
rewardSumHistory_.makeImmutable();
result.rewardSumHistory_ = rewardSumHistory_;
}
if (((from_bitField0_ & 0x00000200) != 0)) {
result.weight_ = weight_;
}
if (((from_bitField0_ & 0x00000400) != 0)) {
result.pendingRewards_ = pendingRewards_;
}
if (((from_bitField0_ & 0x00000800) != 0)) {
result.deleted_ = deleted_;
}
}
@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.StakingNodeInfo) {
return mergeFrom((com.hedera.hashgraph.sdk.proto.StakingNodeInfo)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.hedera.hashgraph.sdk.proto.StakingNodeInfo other) {
if (other == com.hedera.hashgraph.sdk.proto.StakingNodeInfo.getDefaultInstance()) return this;
if (other.getNodeNumber() != 0L) {
setNodeNumber(other.getNodeNumber());
}
if (other.getMinStake() != 0L) {
setMinStake(other.getMinStake());
}
if (other.getMaxStake() != 0L) {
setMaxStake(other.getMaxStake());
}
if (other.getStakeToReward() != 0L) {
setStakeToReward(other.getStakeToReward());
}
if (other.getStakeToNotReward() != 0L) {
setStakeToNotReward(other.getStakeToNotReward());
}
if (other.getStakeRewardStart() != 0L) {
setStakeRewardStart(other.getStakeRewardStart());
}
if (other.getUnclaimedStakeRewardStart() != 0L) {
setUnclaimedStakeRewardStart(other.getUnclaimedStakeRewardStart());
}
if (other.getStake() != 0L) {
setStake(other.getStake());
}
if (!other.rewardSumHistory_.isEmpty()) {
if (rewardSumHistory_.isEmpty()) {
rewardSumHistory_ = other.rewardSumHistory_;
rewardSumHistory_.makeImmutable();
bitField0_ |= 0x00000100;
} else {
ensureRewardSumHistoryIsMutable();
rewardSumHistory_.addAll(other.rewardSumHistory_);
}
onChanged();
}
if (other.getWeight() != 0) {
setWeight(other.getWeight());
}
if (other.getPendingRewards() != 0L) {
setPendingRewards(other.getPendingRewards());
}
if (other.getDeleted() != false) {
setDeleted(other.getDeleted());
}
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: {
nodeNumber_ = input.readInt64();
bitField0_ |= 0x00000001;
break;
} // case 8
case 16: {
minStake_ = input.readInt64();
bitField0_ |= 0x00000002;
break;
} // case 16
case 24: {
maxStake_ = input.readInt64();
bitField0_ |= 0x00000004;
break;
} // case 24
case 32: {
stakeToReward_ = input.readInt64();
bitField0_ |= 0x00000008;
break;
} // case 32
case 40: {
stakeToNotReward_ = input.readInt64();
bitField0_ |= 0x00000010;
break;
} // case 40
case 48: {
stakeRewardStart_ = input.readInt64();
bitField0_ |= 0x00000020;
break;
} // case 48
case 56: {
unclaimedStakeRewardStart_ = input.readInt64();
bitField0_ |= 0x00000040;
break;
} // case 56
case 64: {
stake_ = input.readInt64();
bitField0_ |= 0x00000080;
break;
} // case 64
case 72: {
long v = input.readInt64();
ensureRewardSumHistoryIsMutable();
rewardSumHistory_.addLong(v);
break;
} // case 72
case 74: {
int length = input.readRawVarint32();
int limit = input.pushLimit(length);
ensureRewardSumHistoryIsMutable();
while (input.getBytesUntilLimit() > 0) {
rewardSumHistory_.addLong(input.readInt64());
}
input.popLimit(limit);
break;
} // case 74
case 80: {
weight_ = input.readInt32();
bitField0_ |= 0x00000200;
break;
} // case 80
case 88: {
pendingRewards_ = input.readInt64();
bitField0_ |= 0x00000400;
break;
} // case 88
case 96: {
deleted_ = input.readBool();
bitField0_ |= 0x00000800;
break;
} // case 96
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 bitField0_;
private long nodeNumber_ ;
/**
*
**
* The unique entity number of the node. The shard and realm numbers are implied, based on the network
* this entity came from.
*
*
* int64 node_number = 1;
* @return The nodeNumber.
*/
@java.lang.Override
public long getNodeNumber() {
return nodeNumber_;
}
/**
*
**
* The unique entity number of the node. The shard and realm numbers are implied, based on the network
* this entity came from.
*
*
* int64 node_number = 1;
* @param value The nodeNumber to set.
* @return This builder for chaining.
*/
public Builder setNodeNumber(long value) {
nodeNumber_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
*
**
* The unique entity number of the node. The shard and realm numbers are implied, based on the network
* this entity came from.
*
*
* int64 node_number = 1;
* @return This builder for chaining.
*/
public Builder clearNodeNumber() {
bitField0_ = (bitField0_ & ~0x00000001);
nodeNumber_ = 0L;
onChanged();
return this;
}
private long minStake_ ;
/**
*
**
* The minimum stake on this node that is required for this node to have a non-zero weight to
* participate in the network consensus.
*
*
* int64 min_stake = 2;
* @return The minStake.
*/
@java.lang.Override
public long getMinStake() {
return minStake_;
}
/**
*
**
* The minimum stake on this node that is required for this node to have a non-zero weight to
* participate in the network consensus.
*
*
* int64 min_stake = 2;
* @param value The minStake to set.
* @return This builder for chaining.
*/
public Builder setMinStake(long value) {
minStake_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
*
**
* The minimum stake on this node that is required for this node to have a non-zero weight to
* participate in the network consensus.
*
*
* int64 min_stake = 2;
* @return This builder for chaining.
*/
public Builder clearMinStake() {
bitField0_ = (bitField0_ & ~0x00000002);
minStake_ = 0L;
onChanged();
return this;
}
private long maxStake_ ;
/**
*
**
* The maximum stake on this node that is considered to calculate its weight to participate in the network consensus.
*
*
* int64 max_stake = 3;
* @return The maxStake.
*/
@java.lang.Override
public long getMaxStake() {
return maxStake_;
}
/**
*
**
* The maximum stake on this node that is considered to calculate its weight to participate in the network consensus.
*
*
* int64 max_stake = 3;
* @param value The maxStake to set.
* @return This builder for chaining.
*/
public Builder setMaxStake(long value) {
maxStake_ = value;
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
*
**
* The maximum stake on this node that is considered to calculate its weight to participate in the network consensus.
*
*
* int64 max_stake = 3;
* @return This builder for chaining.
*/
public Builder clearMaxStake() {
bitField0_ = (bitField0_ & ~0x00000004);
maxStake_ = 0L;
onChanged();
return this;
}
private long stakeToReward_ ;
/**
*
**
* The sum of balances of all accounts staked to this node who have opted to receive rewards.
*
*
* int64 stake_to_reward = 4;
* @return The stakeToReward.
*/
@java.lang.Override
public long getStakeToReward() {
return stakeToReward_;
}
/**
*
**
* The sum of balances of all accounts staked to this node who have opted to receive rewards.
*
*
* int64 stake_to_reward = 4;
* @param value The stakeToReward to set.
* @return This builder for chaining.
*/
public Builder setStakeToReward(long value) {
stakeToReward_ = value;
bitField0_ |= 0x00000008;
onChanged();
return this;
}
/**
*
**
* The sum of balances of all accounts staked to this node who have opted to receive rewards.
*
*
* int64 stake_to_reward = 4;
* @return This builder for chaining.
*/
public Builder clearStakeToReward() {
bitField0_ = (bitField0_ & ~0x00000008);
stakeToReward_ = 0L;
onChanged();
return this;
}
private long stakeToNotReward_ ;
/**
*
**
* The sum of balances of all accounts staked to this node who have opted to decline rewards.
*
*
* int64 stake_to_not_reward = 5;
* @return The stakeToNotReward.
*/
@java.lang.Override
public long getStakeToNotReward() {
return stakeToNotReward_;
}
/**
*
**
* The sum of balances of all accounts staked to this node who have opted to decline rewards.
*
*
* int64 stake_to_not_reward = 5;
* @param value The stakeToNotReward to set.
* @return This builder for chaining.
*/
public Builder setStakeToNotReward(long value) {
stakeToNotReward_ = value;
bitField0_ |= 0x00000010;
onChanged();
return this;
}
/**
*
**
* The sum of balances of all accounts staked to this node who have opted to decline rewards.
*
*
* int64 stake_to_not_reward = 5;
* @return This builder for chaining.
*/
public Builder clearStakeToNotReward() {
bitField0_ = (bitField0_ & ~0x00000010);
stakeToNotReward_ = 0L;
onChanged();
return this;
}
private long stakeRewardStart_ ;
/**
*
**
* The snapshot of stake_to_reward value at the beginning of the current staking period.
* This is needed for calculating rewards for current staking period without considering changes to
* stake_to_reward in the current staking period. It is reset at the beginning of every period.
*
*
* int64 stake_reward_start = 6;
* @return The stakeRewardStart.
*/
@java.lang.Override
public long getStakeRewardStart() {
return stakeRewardStart_;
}
/**
*
**
* The snapshot of stake_to_reward value at the beginning of the current staking period.
* This is needed for calculating rewards for current staking period without considering changes to
* stake_to_reward in the current staking period. It is reset at the beginning of every period.
*
*
* int64 stake_reward_start = 6;
* @param value The stakeRewardStart to set.
* @return This builder for chaining.
*/
public Builder setStakeRewardStart(long value) {
stakeRewardStart_ = value;
bitField0_ |= 0x00000020;
onChanged();
return this;
}
/**
*
**
* The snapshot of stake_to_reward value at the beginning of the current staking period.
* This is needed for calculating rewards for current staking period without considering changes to
* stake_to_reward in the current staking period. It is reset at the beginning of every period.
*
*
* int64 stake_reward_start = 6;
* @return This builder for chaining.
*/
public Builder clearStakeRewardStart() {
bitField0_ = (bitField0_ & ~0x00000020);
stakeRewardStart_ = 0L;
onChanged();
return this;
}
private long unclaimedStakeRewardStart_ ;
/**
*
**
* Tracks how much stake from stakeRewardStart will have unclaimed rewards due to accounts changing their staking
* metadata in a way that disqualifies them for the current period; It is reset at the beginning of every period
*
*
* int64 unclaimed_stake_reward_start = 7;
* @return The unclaimedStakeRewardStart.
*/
@java.lang.Override
public long getUnclaimedStakeRewardStart() {
return unclaimedStakeRewardStart_;
}
/**
*
**
* Tracks how much stake from stakeRewardStart will have unclaimed rewards due to accounts changing their staking
* metadata in a way that disqualifies them for the current period; It is reset at the beginning of every period
*
*
* int64 unclaimed_stake_reward_start = 7;
* @param value The unclaimedStakeRewardStart to set.
* @return This builder for chaining.
*/
public Builder setUnclaimedStakeRewardStart(long value) {
unclaimedStakeRewardStart_ = value;
bitField0_ |= 0x00000040;
onChanged();
return this;
}
/**
*
**
* Tracks how much stake from stakeRewardStart will have unclaimed rewards due to accounts changing their staking
* metadata in a way that disqualifies them for the current period; It is reset at the beginning of every period
*
*
* int64 unclaimed_stake_reward_start = 7;
* @return This builder for chaining.
*/
public Builder clearUnclaimedStakeRewardStart() {
bitField0_ = (bitField0_ & ~0x00000040);
unclaimedStakeRewardStart_ = 0L;
onChanged();
return this;
}
private long stake_ ;
/**
*
**
* The total amount of effective hbar staked to this node. This is sum of stake_to_reward and stake_to_not_reward.
* If the sum is greater than max_stake, then the effective stake is max_stake.
* If the sum is less than min_stake, then the effective stake is 0.
*
*
* int64 stake = 8;
* @return The stake.
*/
@java.lang.Override
public long getStake() {
return stake_;
}
/**
*
**
* The total amount of effective hbar staked to this node. This is sum of stake_to_reward and stake_to_not_reward.
* If the sum is greater than max_stake, then the effective stake is max_stake.
* If the sum is less than min_stake, then the effective stake is 0.
*
*
* int64 stake = 8;
* @param value The stake to set.
* @return This builder for chaining.
*/
public Builder setStake(long value) {
stake_ = value;
bitField0_ |= 0x00000080;
onChanged();
return this;
}
/**
*
**
* The total amount of effective hbar staked to this node. This is sum of stake_to_reward and stake_to_not_reward.
* If the sum is greater than max_stake, then the effective stake is max_stake.
* If the sum is less than min_stake, then the effective stake is 0.
*
*
* int64 stake = 8;
* @return This builder for chaining.
*/
public Builder clearStake() {
bitField0_ = (bitField0_ & ~0x00000080);
stake_ = 0L;
onChanged();
return this;
}
private com.google.protobuf.Internal.LongList rewardSumHistory_ = emptyLongList();
private void ensureRewardSumHistoryIsMutable() {
if (!rewardSumHistory_.isModifiable()) {
rewardSumHistory_ = makeMutableCopy(rewardSumHistory_);
}
bitField0_ |= 0x00000100;
}
/**
*
**
* An running sum of reward rates per hbar for the last 365+1 staking periods. The first element is the
* is the reward up to and including the last full period that finished before the present. Second element is
* the reward up to and including the period before that
*
*
* repeated int64 reward_sum_history = 9;
* @return A list containing the rewardSumHistory.
*/
public java.util.List
getRewardSumHistoryList() {
rewardSumHistory_.makeImmutable();
return rewardSumHistory_;
}
/**
*
**
* An running sum of reward rates per hbar for the last 365+1 staking periods. The first element is the
* is the reward up to and including the last full period that finished before the present. Second element is
* the reward up to and including the period before that
*
*
* repeated int64 reward_sum_history = 9;
* @return The count of rewardSumHistory.
*/
public int getRewardSumHistoryCount() {
return rewardSumHistory_.size();
}
/**
*
**
* An running sum of reward rates per hbar for the last 365+1 staking periods. The first element is the
* is the reward up to and including the last full period that finished before the present. Second element is
* the reward up to and including the period before that
*
*
* repeated int64 reward_sum_history = 9;
* @param index The index of the element to return.
* @return The rewardSumHistory at the given index.
*/
public long getRewardSumHistory(int index) {
return rewardSumHistory_.getLong(index);
}
/**
*
**
* An running sum of reward rates per hbar for the last 365+1 staking periods. The first element is the
* is the reward up to and including the last full period that finished before the present. Second element is
* the reward up to and including the period before that
*
*
* repeated int64 reward_sum_history = 9;
* @param index The index to set the value at.
* @param value The rewardSumHistory to set.
* @return This builder for chaining.
*/
public Builder setRewardSumHistory(
int index, long value) {
ensureRewardSumHistoryIsMutable();
rewardSumHistory_.setLong(index, value);
bitField0_ |= 0x00000100;
onChanged();
return this;
}
/**
*
**
* An running sum of reward rates per hbar for the last 365+1 staking periods. The first element is the
* is the reward up to and including the last full period that finished before the present. Second element is
* the reward up to and including the period before that
*
*
* repeated int64 reward_sum_history = 9;
* @param value The rewardSumHistory to add.
* @return This builder for chaining.
*/
public Builder addRewardSumHistory(long value) {
ensureRewardSumHistoryIsMutable();
rewardSumHistory_.addLong(value);
bitField0_ |= 0x00000100;
onChanged();
return this;
}
/**
*
**
* An running sum of reward rates per hbar for the last 365+1 staking periods. The first element is the
* is the reward up to and including the last full period that finished before the present. Second element is
* the reward up to and including the period before that
*
*
* repeated int64 reward_sum_history = 9;
* @param values The rewardSumHistory to add.
* @return This builder for chaining.
*/
public Builder addAllRewardSumHistory(
java.lang.Iterable extends java.lang.Long> values) {
ensureRewardSumHistoryIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, rewardSumHistory_);
bitField0_ |= 0x00000100;
onChanged();
return this;
}
/**
*
**
* An running sum of reward rates per hbar for the last 365+1 staking periods. The first element is the
* is the reward up to and including the last full period that finished before the present. Second element is
* the reward up to and including the period before that
*
*
* repeated int64 reward_sum_history = 9;
* @return This builder for chaining.
*/
public Builder clearRewardSumHistory() {
rewardSumHistory_ = emptyLongList();
bitField0_ = (bitField0_ & ~0x00000100);
onChanged();
return this;
}
private int weight_ ;
/**
*
**
* The consensus weight of this node in the network. This is computed based on the stake of this node
* at midnight UTC of the current day. If the stake of this node is less than minStake, then the weight is 0.
* Sum of all weights of nodes in the network should be less than 500.
* If the stake of this node A is greater than minStake, then the weight of this node A is calculated as:
* (node A stake * 500/ total stake of all nodes)
*
*
* int32 weight = 10;
* @return The weight.
*/
@java.lang.Override
public int getWeight() {
return weight_;
}
/**
*
**
* The consensus weight of this node in the network. This is computed based on the stake of this node
* at midnight UTC of the current day. If the stake of this node is less than minStake, then the weight is 0.
* Sum of all weights of nodes in the network should be less than 500.
* If the stake of this node A is greater than minStake, then the weight of this node A is calculated as:
* (node A stake * 500/ total stake of all nodes)
*
*
* int32 weight = 10;
* @param value The weight to set.
* @return This builder for chaining.
*/
public Builder setWeight(int value) {
weight_ = value;
bitField0_ |= 0x00000200;
onChanged();
return this;
}
/**
*
**
* The consensus weight of this node in the network. This is computed based on the stake of this node
* at midnight UTC of the current day. If the stake of this node is less than minStake, then the weight is 0.
* Sum of all weights of nodes in the network should be less than 500.
* If the stake of this node A is greater than minStake, then the weight of this node A is calculated as:
* (node A stake * 500/ total stake of all nodes)
*
*
* int32 weight = 10;
* @return This builder for chaining.
*/
public Builder clearWeight() {
bitField0_ = (bitField0_ & ~0x00000200);
weight_ = 0;
onChanged();
return this;
}
private long pendingRewards_ ;
/**
*
**
* The total staking rewards in tinybars that COULD be collected by all accounts staking to the current node after the end
* of this staking period; assuming that no account "renounces" its rewards by, for example, setting declineReward=true.
* When the current node is deleted, this amount will be subtracted from the total pending rewards of all accounts staking
* to all nodes in the network in NetworkStakingRewards.
*
*
* int64 pending_rewards = 11;
* @return The pendingRewards.
*/
@java.lang.Override
public long getPendingRewards() {
return pendingRewards_;
}
/**
*
**
* The total staking rewards in tinybars that COULD be collected by all accounts staking to the current node after the end
* of this staking period; assuming that no account "renounces" its rewards by, for example, setting declineReward=true.
* When the current node is deleted, this amount will be subtracted from the total pending rewards of all accounts staking
* to all nodes in the network in NetworkStakingRewards.
*
*
* int64 pending_rewards = 11;
* @param value The pendingRewards to set.
* @return This builder for chaining.
*/
public Builder setPendingRewards(long value) {
pendingRewards_ = value;
bitField0_ |= 0x00000400;
onChanged();
return this;
}
/**
*
**
* The total staking rewards in tinybars that COULD be collected by all accounts staking to the current node after the end
* of this staking period; assuming that no account "renounces" its rewards by, for example, setting declineReward=true.
* When the current node is deleted, this amount will be subtracted from the total pending rewards of all accounts staking
* to all nodes in the network in NetworkStakingRewards.
*
*
* int64 pending_rewards = 11;
* @return This builder for chaining.
*/
public Builder clearPendingRewards() {
bitField0_ = (bitField0_ & ~0x00000400);
pendingRewards_ = 0L;
onChanged();
return this;
}
private boolean deleted_ ;
/**
*
**
* True if this node has been deleted from network.
*
*
* bool deleted = 12;
* @return The deleted.
*/
@java.lang.Override
public boolean getDeleted() {
return deleted_;
}
/**
*
**
* True if this node has been deleted from network.
*
*
* bool deleted = 12;
* @param value The deleted to set.
* @return This builder for chaining.
*/
public Builder setDeleted(boolean value) {
deleted_ = value;
bitField0_ |= 0x00000800;
onChanged();
return this;
}
/**
*
**
* True if this node has been deleted from network.
*
*
* bool deleted = 12;
* @return This builder for chaining.
*/
public Builder clearDeleted() {
bitField0_ = (bitField0_ & ~0x00000800);
deleted_ = false;
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.StakingNodeInfo)
}
// @@protoc_insertion_point(class_scope:proto.StakingNodeInfo)
private static final com.hedera.hashgraph.sdk.proto.StakingNodeInfo DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.hedera.hashgraph.sdk.proto.StakingNodeInfo();
}
public static com.hedera.hashgraph.sdk.proto.StakingNodeInfo getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public StakingNodeInfo 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.StakingNodeInfo getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}