Class AccountStateBuilder

  • All Implemented Interfaces:
    Serializer

    public class AccountStateBuilder
    extends java.lang.Object
    implements Serializer
    Binary layout for non-historical account state
    • Constructor Detail

      • AccountStateBuilder

        protected AccountStateBuilder​(java.io.DataInputStream stream)
        Constructor - Creates an object from stream.
        Parameters:
        stream - Byte stream to use to serialize the object.
      • AccountStateBuilder

        protected AccountStateBuilder​(AddressDto address,
                                      HeightDto addressHeight,
                                      KeyDto publicKey,
                                      HeightDto publicKeyHeight,
                                      AccountTypeDto accountType,
                                      AccountStateFormatDto format,
                                      java.util.EnumSet<AccountKeyTypeFlagsDto> supplementalPublicKeysMask,
                                      KeyDto linkedPublicKey,
                                      KeyDto nodePublicKey,
                                      KeyDto vrfPublicKey,
                                      java.util.List<PinnedVotingKeyBuilder> votingPublicKeys,
                                      ImportanceSnapshotBuilder importanceSnapshots,
                                      HeightActivityBucketsBuilder activityBuckets,
                                      java.util.List<MosaicBuilder> balances)
        Constructor.
        Parameters:
        address - Address of account.
        addressHeight - Height at which address has been obtained.
        publicKey - Public key of account.
        publicKeyHeight - Height at which public key has been obtained.
        accountType - Type of account.
        format - Account format.
        supplementalPublicKeysMask - Mask of supplemental public key flags.
        linkedPublicKey - Linked account public key.
        nodePublicKey - Node public key.
        vrfPublicKey - Vrf public key.
        votingPublicKeys - Voting public keys.
        importanceSnapshots - Current importance snapshot of the account.
        activityBuckets - Activity buckets of the account.
        balances - Balances of account.
    • Method Detail

      • loadFromBinary

        public static AccountStateBuilder loadFromBinary​(java.io.DataInputStream stream)
        Creates an instance of AccountStateBuilder from a stream.
        Parameters:
        stream - Byte stream to use to serialize the object.
        Returns:
        Instance of AccountStateBuilder.
      • createRegular

        public static AccountStateBuilder createRegular​(AddressDto address,
                                                        HeightDto addressHeight,
                                                        KeyDto publicKey,
                                                        HeightDto publicKeyHeight,
                                                        AccountTypeDto accountType,
                                                        java.util.EnumSet<AccountKeyTypeFlagsDto> supplementalPublicKeysMask,
                                                        KeyDto linkedPublicKey,
                                                        KeyDto nodePublicKey,
                                                        KeyDto vrfPublicKey,
                                                        java.util.List<PinnedVotingKeyBuilder> votingPublicKeys,
                                                        java.util.List<MosaicBuilder> balances)
        Creates an instance of AccountStateBuilder.
        Parameters:
        address - Address of account.
        addressHeight - Height at which address has been obtained.
        publicKey - Public key of account.
        publicKeyHeight - Height at which public key has been obtained.
        accountType - Type of account.
        supplementalPublicKeysMask - Mask of supplemental public key flags.
        linkedPublicKey - Linked account public key.
        nodePublicKey - Node public key.
        vrfPublicKey - Vrf public key.
        votingPublicKeys - Voting public keys.
        balances - Balances of account.
        Returns:
        Instance of AccountStateBuilder.
      • createHighValue

        public static AccountStateBuilder createHighValue​(AddressDto address,
                                                          HeightDto addressHeight,
                                                          KeyDto publicKey,
                                                          HeightDto publicKeyHeight,
                                                          AccountTypeDto accountType,
                                                          java.util.EnumSet<AccountKeyTypeFlagsDto> supplementalPublicKeysMask,
                                                          KeyDto linkedPublicKey,
                                                          KeyDto nodePublicKey,
                                                          KeyDto vrfPublicKey,
                                                          java.util.List<PinnedVotingKeyBuilder> votingPublicKeys,
                                                          ImportanceSnapshotBuilder importanceSnapshots,
                                                          HeightActivityBucketsBuilder activityBuckets,
                                                          java.util.List<MosaicBuilder> balances)
        Creates an instance of AccountStateBuilder.
        Parameters:
        address - Address of account.
        addressHeight - Height at which address has been obtained.
        publicKey - Public key of account.
        publicKeyHeight - Height at which public key has been obtained.
        accountType - Type of account.
        supplementalPublicKeysMask - Mask of supplemental public key flags.
        linkedPublicKey - Linked account public key.
        nodePublicKey - Node public key.
        vrfPublicKey - Vrf public key.
        votingPublicKeys - Voting public keys.
        importanceSnapshots - Current importance snapshot of the account.
        activityBuckets - Activity buckets of the account.
        balances - Balances of account.
        Returns:
        Instance of AccountStateBuilder.
      • getAddress

        public AddressDto getAddress()
        Gets address of account.
        Returns:
        Address of account.
      • getAddressHeight

        public HeightDto getAddressHeight()
        Gets height at which address has been obtained.
        Returns:
        Height at which address has been obtained.
      • getPublicKey

        public KeyDto getPublicKey()
        Gets public key of account.
        Returns:
        Public key of account.
      • getPublicKeyHeight

        public HeightDto getPublicKeyHeight()
        Gets height at which public key has been obtained.
        Returns:
        Height at which public key has been obtained.
      • getAccountType

        public AccountTypeDto getAccountType()
        Gets type of account.
        Returns:
        Type of account.
      • getSupplementalPublicKeysMask

        public java.util.EnumSet<AccountKeyTypeFlagsDto> getSupplementalPublicKeysMask()
        Gets mask of supplemental public key flags.
        Returns:
        Mask of supplemental public key flags.
      • getLinkedPublicKey

        public KeyDto getLinkedPublicKey()
        Gets linked account public key.
        Returns:
        Linked account public key.
      • getNodePublicKey

        public KeyDto getNodePublicKey()
        Gets node public key.
        Returns:
        Node public key.
      • getVrfPublicKey

        public KeyDto getVrfPublicKey()
        Gets vrf public key.
        Returns:
        Vrf public key.
      • getVotingPublicKeys

        public java.util.List<PinnedVotingKeyBuilder> getVotingPublicKeys()
        Gets voting public keys.
        Returns:
        Voting public keys.
      • getImportanceSnapshots

        public ImportanceSnapshotBuilder getImportanceSnapshots()
        Gets current importance snapshot of the account.
        Returns:
        Current importance snapshot of the account.
      • getActivityBuckets

        public HeightActivityBucketsBuilder getActivityBuckets()
        Gets activity buckets of the account.
        Returns:
        Activity buckets of the account.
      • getBalances

        public java.util.List<MosaicBuilder> getBalances()
        Gets balances of account.
        Returns:
        Balances of account.
      • 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.