Package io.nem.symbol.catapult.builders
Class AccountStateBuilder
- java.lang.Object
-
- io.nem.symbol.catapult.builders.AccountStateBuilder
-
- All Implemented Interfaces:
Serializer
public class AccountStateBuilder extends java.lang.Object implements Serializer
Binary layout for non-historical account state
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAccountStateBuilder(AddressDto address, HeightDto addressHeight, KeyDto publicKey, HeightDto publicKeyHeight, AccountTypeDto accountType, AccountStateFormatDto format, java.util.EnumSet<AccountKeyFlagsDto> supplementalAccountKeysMask, KeyDto linkedPublicKey, KeyDto vrfPublicKey, VotingKeyDto votingPublicKey, KeyDto nodePublicKey, ImportanceSnapshotBuilder importanceSnapshots, HeightActivityBucketsBuilder activityBuckets, MosaicIdDto currencyMosaicId, 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(AddressDto address, HeightDto addressHeight, KeyDto publicKey, HeightDto publicKeyHeight, AccountTypeDto accountType, java.util.EnumSet<AccountKeyFlagsDto> supplementalAccountKeysMask, KeyDto linkedPublicKey, KeyDto vrfPublicKey, VotingKeyDto votingPublicKey, KeyDto nodePublicKey, ImportanceSnapshotBuilder importanceSnapshots, HeightActivityBucketsBuilder activityBuckets, MosaicIdDto currencyMosaicId, java.util.List<MosaicBuilder> balances)Creates an instance of AccountStateBuilder.static AccountStateBuildercreateRegular(AddressDto address, HeightDto addressHeight, KeyDto publicKey, HeightDto publicKeyHeight, AccountTypeDto accountType, java.util.EnumSet<AccountKeyFlagsDto> supplementalAccountKeysMask, KeyDto linkedPublicKey, KeyDto vrfPublicKey, VotingKeyDto votingPublicKey, KeyDto nodePublicKey, MosaicIdDto currencyMosaicId, 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.MosaicIdDtogetCurrencyMosaicId()Gets currency mosaic id.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<AccountKeyFlagsDto>getSupplementalAccountKeysMask()Gets mask of supplemental account key flags.VotingKeyDtogetVotingPublicKey()Gets voting public key.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.
-
-
-
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<AccountKeyFlagsDto> supplementalAccountKeysMask, KeyDto linkedPublicKey, KeyDto vrfPublicKey, VotingKeyDto votingPublicKey, KeyDto nodePublicKey, ImportanceSnapshotBuilder importanceSnapshots, HeightActivityBucketsBuilder activityBuckets, MosaicIdDto currencyMosaicId, 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.supplementalAccountKeysMask- Mask of supplemental account key flags.linkedPublicKey- Linked account public key.vrfPublicKey- Vrf public key.votingPublicKey- Voting public key.nodePublicKey- Node public key.importanceSnapshots- Current importance snapshot of the account.activityBuckets- Activity buckets of the account.currencyMosaicId- Currency mosaic id.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.
-
createHighValue
public static AccountStateBuilder createHighValue(AddressDto address, HeightDto addressHeight, KeyDto publicKey, HeightDto publicKeyHeight, AccountTypeDto accountType, java.util.EnumSet<AccountKeyFlagsDto> supplementalAccountKeysMask, KeyDto linkedPublicKey, KeyDto vrfPublicKey, VotingKeyDto votingPublicKey, KeyDto nodePublicKey, ImportanceSnapshotBuilder importanceSnapshots, HeightActivityBucketsBuilder activityBuckets, MosaicIdDto currencyMosaicId, 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.supplementalAccountKeysMask- Mask of supplemental account key flags.linkedPublicKey- Linked account public key.vrfPublicKey- Vrf public key.votingPublicKey- Voting public key.nodePublicKey- Node public key.importanceSnapshots- Current importance snapshot of the account.activityBuckets- Activity buckets of the account.currencyMosaicId- Currency mosaic id.balances- Balances of account.- Returns:
- Instance of AccountStateBuilder.
-
createRegular
public static AccountStateBuilder createRegular(AddressDto address, HeightDto addressHeight, KeyDto publicKey, HeightDto publicKeyHeight, AccountTypeDto accountType, java.util.EnumSet<AccountKeyFlagsDto> supplementalAccountKeysMask, KeyDto linkedPublicKey, KeyDto vrfPublicKey, VotingKeyDto votingPublicKey, KeyDto nodePublicKey, MosaicIdDto currencyMosaicId, 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.supplementalAccountKeysMask- Mask of supplemental account key flags.linkedPublicKey- Linked account public key.vrfPublicKey- Vrf public key.votingPublicKey- Voting public key.nodePublicKey- Node public key.currencyMosaicId- Currency mosaic id.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.
-
getSupplementalAccountKeysMask
public java.util.EnumSet<AccountKeyFlagsDto> getSupplementalAccountKeysMask()
Gets mask of supplemental account key flags.- Returns:
- Mask of supplemental account key flags.
-
getLinkedPublicKey
public KeyDto getLinkedPublicKey()
Gets linked account public key.- Returns:
- Linked account public key.
-
getVrfPublicKey
public KeyDto getVrfPublicKey()
Gets vrf public key.- Returns:
- Vrf public key.
-
getVotingPublicKey
public VotingKeyDto getVotingPublicKey()
Gets voting public key.- Returns:
- Voting public key.
-
getNodePublicKey
public KeyDto getNodePublicKey()
Gets node public key.- Returns:
- Node public key.
-
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.
-
getCurrencyMosaicId
public MosaicIdDto getCurrencyMosaicId()
Gets currency mosaic id.- Returns:
- Currency mosaic id.
-
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- Returns:
- Size in bytes.
-
serialize
public byte[] serialize()
Serializes an object to bytes.- Specified by:
serializein interfaceSerializer- Returns:
- Serialized bytes.
-
-