Package io.nem.symbol.catapult.builders
Class ImportanceBlockFooterBuilder
- java.lang.Object
-
- io.nem.symbol.catapult.builders.ImportanceBlockFooterBuilder
-
- All Implemented Interfaces:
Serializer
public class ImportanceBlockFooterBuilder extends java.lang.Object implements Serializer
Binary layout for an importance block footer
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedImportanceBlockFooterBuilder(int votingEligibleAccountsCount, long harvestingEligibleAccountsCount, AmountDto totalVotingBalance, Hash256Dto previousImportanceBlockHash)Constructor.protectedImportanceBlockFooterBuilder(java.io.DataInputStream stream)Constructor - Creates an object from stream.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImportanceBlockFooterBuildercreate(int votingEligibleAccountsCount, long harvestingEligibleAccountsCount, AmountDto totalVotingBalance, Hash256Dto previousImportanceBlockHash)Creates an instance of ImportanceBlockFooterBuilder.longgetHarvestingEligibleAccountsCount()Gets number of harvesting eligible accounts.Hash256DtogetPreviousImportanceBlockHash()Gets previous importance block hash.intgetSize()Gets the size of the object.AmountDtogetTotalVotingBalance()Gets total balance eligible for voting.intgetVotingEligibleAccountsCount()Gets number of voting eligible accounts.static ImportanceBlockFooterBuilderloadFromBinary(java.io.DataInputStream stream)Creates an instance of ImportanceBlockFooterBuilder from a stream.byte[]serialize()Serializes an object to bytes.
-
-
-
Constructor Detail
-
ImportanceBlockFooterBuilder
protected ImportanceBlockFooterBuilder(java.io.DataInputStream stream)
Constructor - Creates an object from stream.- Parameters:
stream- Byte stream to use to serialize the object.
-
ImportanceBlockFooterBuilder
protected ImportanceBlockFooterBuilder(int votingEligibleAccountsCount, long harvestingEligibleAccountsCount, AmountDto totalVotingBalance, Hash256Dto previousImportanceBlockHash)Constructor.- Parameters:
votingEligibleAccountsCount- Number of voting eligible accounts.harvestingEligibleAccountsCount- Number of harvesting eligible accounts.totalVotingBalance- Total balance eligible for voting.previousImportanceBlockHash- Previous importance block hash.
-
-
Method Detail
-
loadFromBinary
public static ImportanceBlockFooterBuilder loadFromBinary(java.io.DataInputStream stream)
Creates an instance of ImportanceBlockFooterBuilder from a stream.- Parameters:
stream- Byte stream to use to serialize the object.- Returns:
- Instance of ImportanceBlockFooterBuilder.
-
create
public static ImportanceBlockFooterBuilder create(int votingEligibleAccountsCount, long harvestingEligibleAccountsCount, AmountDto totalVotingBalance, Hash256Dto previousImportanceBlockHash)
Creates an instance of ImportanceBlockFooterBuilder.- Parameters:
votingEligibleAccountsCount- Number of voting eligible accounts.harvestingEligibleAccountsCount- Number of harvesting eligible accounts.totalVotingBalance- Total balance eligible for voting.previousImportanceBlockHash- Previous importance block hash.- Returns:
- Instance of ImportanceBlockFooterBuilder.
-
getVotingEligibleAccountsCount
public int getVotingEligibleAccountsCount()
Gets number of voting eligible accounts.- Returns:
- Number of voting eligible accounts.
-
getHarvestingEligibleAccountsCount
public long getHarvestingEligibleAccountsCount()
Gets number of harvesting eligible accounts.- Returns:
- Number of harvesting eligible accounts.
-
getTotalVotingBalance
public AmountDto getTotalVotingBalance()
Gets total balance eligible for voting.- Returns:
- Total balance eligible for voting.
-
getPreviousImportanceBlockHash
public Hash256Dto getPreviousImportanceBlockHash()
Gets previous importance block hash.- Returns:
- Previous importance block hash.
-
getSize
public int getSize()
Gets the size of the object.- Specified by:
getSizein interfaceSerializer- Returns:
- Size in bytes.
-
serialize
public byte[] serialize()
Serializes an object to bytes.- Specified by:
serializein interfaceSerializer- Returns:
- Serialized bytes.
-
-