Package io.nem.symbol.catapult.builders
Class AccountStateBuilder
- java.lang.Object
-
- io.nem.symbol.catapult.builders.StateHeaderBuilder
-
- io.nem.symbol.catapult.builders.AccountStateBuilder
-
- All Implemented Interfaces:
Serializer
public class AccountStateBuilder extends StateHeaderBuilder implements Serializer
Binary layout for non-historical account state
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAccountStateBuilder(short version, 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.protectedAccountStateBuilder(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 AccountStateBuildercreateHighValue(short version, 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.static AccountStateBuildercreateRegular(short version, 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.AccountTypeDtogetAccountType()Gets type of account.HeightActivityBucketsBuildergetActivityBuckets()Gets activity buckets of the account.AddressDtogetAddress()Gets address of account.HeightDtogetAddressHeight()Gets height at which address has been obtained.java.util.List<MosaicBuilder>getBalances()Gets balances of account.AccountStateFormatDtogetFormat()Gets account format.ImportanceSnapshotBuildergetImportanceSnapshots()Gets current importance snapshot of the account.KeyDtogetLinkedPublicKey()Gets linked account public key.KeyDtogetNodePublicKey()Gets node public key.KeyDtogetPublicKey()Gets public key of account.HeightDtogetPublicKeyHeight()Gets height at which public key has been obtained.intgetSize()Gets the size of the object.java.util.EnumSet<AccountKeyTypeFlagsDto>getSupplementalPublicKeysMask()Gets mask of supplemental public key flags.java.util.List<PinnedVotingKeyBuilder>getVotingPublicKeys()Gets voting public keys.KeyDtogetVrfPublicKey()Gets vrf public key.static AccountStateBuilderloadFromBinary(java.io.DataInputStream stream)Creates an instance of AccountStateBuilder from a stream.byte[]serialize()Serializes an object to bytes.-
Methods inherited from class io.nem.symbol.catapult.builders.StateHeaderBuilder
create, getVersion
-
-
-
-
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(short version, 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:
version- Serialization version.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(short version, 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:
version- Serialization version.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(short version, 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:
version- Serialization version.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.
-
getFormat
public AccountStateFormatDto getFormat()
Gets account format.- Returns:
- Account format.
-
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:
getSizein interfaceSerializer- Overrides:
getSizein classStateHeaderBuilder- Returns:
- Size in bytes.
-
serialize
public byte[] serialize()
Serializes an object to bytes.- Specified by:
serializein interfaceSerializer- Overrides:
serializein classStateHeaderBuilder- Returns:
- Serialized bytes.
-
-