Class ImportanceBlockFooterBuilder

  • All Implemented Interfaces:
    Serializer

    public class ImportanceBlockFooterBuilder
    extends java.lang.Object
    implements Serializer
    Binary layout for an importance block footer
    • 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:
        getSize in interface Serializer
        Returns:
        Size in bytes.
      • serialize

        public byte[] serialize()
        Serializes an object to bytes.
        Specified by:
        serialize in interface Serializer
        Returns:
        Serialized bytes.