java.lang.Object
java.lang.Record
software.sava.core.accounts.token.TokenAccount
- All Implemented Interfaces:
Borsh,Serializable
-
Nested Class Summary
Nested classes/interfaces inherited from interface software.sava.core.borsh.Borsh
Borsh.Enum, Borsh.Factory<T> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final BiFunction<PublicKey, byte[], TokenAccount> static final intstatic final intstatic final intstatic final intstatic final intstatic final Filter -
Constructor Summary
ConstructorsConstructorDescriptionTokenAccount(PublicKey address, PublicKey mint, PublicKey owner, long amount, int delegateOption, PublicKey delegate, AccountState state, int isNativeOption, long isNative, long delegatedAmount, int closeAuthorityOption, PublicKey closeAuthority) Creates an instance of aTokenAccountrecord class. -
Method Summary
Modifier and TypeMethodDescriptionaddress()Returns the value of theaddressrecord component.longamount()Returns the value of theamountrecord component.Returns the value of thecloseAuthorityrecord component.intReturns the value of thecloseAuthorityOptionrecord component.static FiltercreateCloseAuthorityFilter(PublicKey closeAuthority) static FiltercreateDelegateFilter(PublicKey delegate) static FiltercreateMintFilter(PublicKey mint) static FiltercreateOwnerFilter(PublicKey owner) delegate()Returns the value of thedelegaterecord component.longReturns the value of thedelegatedAmountrecord component.intReturns the value of thedelegateOptionrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.longisNative()Returns the value of theisNativerecord component.intReturns the value of theisNativeOptionrecord component.intl()mint()Returns the value of themintrecord component.owner()Returns the value of theownerrecord component.static TokenAccountstatic TokenAccountstate()Returns the value of thestaterecord component.final StringtoString()Returns a string representation of this record class.intwrite(byte[] data, int offset) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface software.sava.core.borsh.Borsh
writeOptionalMethods inherited from interface software.sava.core.serial.Serializable
reusable, write, write
-
Field Details
-
BYTES
public static final int BYTES- See Also:
-
TOKEN_ACCOUNT_SIZE_FILTER
-
MINT_OFFSET
public static final int MINT_OFFSET- See Also:
-
OWNER_OFFSET
public static final int OWNER_OFFSET- See Also:
-
AMOUNT_OFFSET
public static final int AMOUNT_OFFSET- See Also:
-
DELEGATE_OPTION_OFFSET
public static final int DELEGATE_OPTION_OFFSET- See Also:
-
DELEGATE_OFFSET
public static final int DELEGATE_OFFSET- See Also:
-
STATE_OFFSET
public static final int STATE_OFFSET- See Also:
-
IS_NATIVE_OPTION_OFFSET
public static final int IS_NATIVE_OPTION_OFFSET- See Also:
-
IS_NATIVE_OFFSET
public static final int IS_NATIVE_OFFSET- See Also:
-
DELEGATED_AMOUNT_OFFSET
public static final int DELEGATED_AMOUNT_OFFSET- See Also:
-
CLOSE_AUTHORITY_OPTION_OFFSET
public static final int CLOSE_AUTHORITY_OPTION_OFFSET- See Also:
-
CLOSE_AUTHORITY_OFFSET
public static final int CLOSE_AUTHORITY_OFFSET- See Also:
-
FACTORY
-
-
Constructor Details
-
TokenAccount
public TokenAccount(PublicKey address, PublicKey mint, PublicKey owner, long amount, int delegateOption, PublicKey delegate, AccountState state, int isNativeOption, long isNative, long delegatedAmount, int closeAuthorityOption, PublicKey closeAuthority) Creates an instance of aTokenAccountrecord class.- Parameters:
address- the value for theaddressrecord componentmint- the value for themintrecord componentowner- the value for theownerrecord componentamount- the value for theamountrecord componentdelegateOption- the value for thedelegateOptionrecord componentdelegate- the value for thedelegaterecord componentstate- the value for thestaterecord componentisNativeOption- the value for theisNativeOptionrecord componentisNative- the value for theisNativerecord componentdelegatedAmount- the value for thedelegatedAmountrecord componentcloseAuthorityOption- the value for thecloseAuthorityOptionrecord componentcloseAuthority- the value for thecloseAuthorityrecord component
-
-
Method Details
-
createMintFilter
-
createOwnerFilter
-
createDelegateFilter
-
createCloseAuthorityFilter
-
read
-
read
-
write
public int write(byte[] data, int offset) - Specified by:
writein interfaceSerializable
-
l
public int l()- Specified by:
lin interfaceSerializable
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
address
Returns the value of theaddressrecord component.- Returns:
- the value of the
addressrecord component
-
mint
Returns the value of themintrecord component.- Returns:
- the value of the
mintrecord component
-
owner
Returns the value of theownerrecord component.- Returns:
- the value of the
ownerrecord component
-
amount
public long amount()Returns the value of theamountrecord component.- Returns:
- the value of the
amountrecord component
-
delegateOption
public int delegateOption()Returns the value of thedelegateOptionrecord component.- Returns:
- the value of the
delegateOptionrecord component
-
delegate
Returns the value of thedelegaterecord component.- Returns:
- the value of the
delegaterecord component
-
state
Returns the value of thestaterecord component.- Returns:
- the value of the
staterecord component
-
isNativeOption
public int isNativeOption()Returns the value of theisNativeOptionrecord component.- Returns:
- the value of the
isNativeOptionrecord component
-
isNative
public long isNative()Returns the value of theisNativerecord component.- Returns:
- the value of the
isNativerecord component
-
delegatedAmount
public long delegatedAmount()Returns the value of thedelegatedAmountrecord component.- Returns:
- the value of the
delegatedAmountrecord component
-
closeAuthorityOption
public int closeAuthorityOption()Returns the value of thecloseAuthorityOptionrecord component.- Returns:
- the value of the
closeAuthorityOptionrecord component
-
closeAuthority
Returns the value of thecloseAuthorityrecord component.- Returns:
- the value of the
closeAuthorityrecord component
-