Package org.xrpl.xrpl4j.model.ledger
Class ImmutableMpTokenObject
java.lang.Object
org.xrpl.xrpl4j.model.ledger.ImmutableMpTokenObject
- All Implemented Interfaces:
LedgerObject,MpTokenObject
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@Immutable
@CheckReturnValue
public final class ImmutableMpTokenObject
extends Object
implements MpTokenObject
Immutable implementation of
MpTokenObject.
Use the builder to create immutable instances:
ImmutableMpTokenObject.builder().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableMpTokenObject.Nested classes/interfaces inherited from interface org.xrpl.xrpl4j.model.ledger.LedgerObject
LedgerObject.LedgerEntryType -
Method Summary
Modifier and TypeMethodDescriptionaccount()TheAddressof the owner of this MPToken.builder()Creates a builder forImmutableMpTokenObject.static ImmutableMpTokenObjectcopyOf(MpTokenObject instance) Creates an immutable copy of aMpTokenObjectvalue.booleanThis instance is equal to all instances ofImmutableMpTokenObjectthat have equal attribute values.flags()TheMpTokenFlagsfor this token.inthashCode()Computes a hash code from attributes:ledgerEntryType,flags,account,mpTokenIssuanceId,mptAmount,lockedAmount,previousTransactionId,previousTransactionLedgerSequence,ownerNode,index.index()The unique ID of thisMpTokenObject.The amount of this MPToken that is locked in escrows.The balance of this MPToken.TheMpTokenIssuanceIdof the MPTokenIssuance that this token corresponds to.A hint indicating which page of the owner directory links to this object, in case the directory consists of multiple pages.The identifying hash of the transaction that most recently modified this object.com.google.common.primitives.UnsignedIntegerThe index of the ledger that contains the transaction that most recently modified this object.toString()Prints the immutable valueMpTokenObjectwith attribute values.final ImmutableMpTokenObjectwithAccount(Address value) Copy the current immutable object by setting a value for theaccountattribute.final ImmutableMpTokenObjectwithFlags(MpTokenFlags value) Copy the current immutable object by setting a value for theflagsattribute.final ImmutableMpTokenObjectCopy the current immutable object by setting a value for theindexattribute.final ImmutableMpTokenObjectwithLockedAmount(Optional<? extends MpTokenNumericAmount> optional) Copy the current immutable object by setting an optional value for thelockedAmountattribute.final ImmutableMpTokenObjectCopy the current immutable object by setting a present value for the optionallockedAmountattribute.final ImmutableMpTokenObjectCopy the current immutable object by setting a value for themptAmountattribute.final ImmutableMpTokenObjectCopy the current immutable object by setting a value for thempTokenIssuanceIdattribute.final ImmutableMpTokenObjectwithOwnerNode(String value) Copy the current immutable object by setting a present value for the optionalownerNodeattribute.final ImmutableMpTokenObjectwithOwnerNode(Optional<String> optional) Copy the current immutable object by setting an optional value for theownerNodeattribute.final ImmutableMpTokenObjectwithPreviousTransactionId(Hash256 value) Copy the current immutable object by setting a value for thepreviousTransactionIdattribute.final ImmutableMpTokenObjectwithPreviousTransactionLedgerSequence(com.google.common.primitives.UnsignedInteger value) Copy the current immutable object by setting a value for thepreviousTransactionLedgerSequenceattribute.
-
Method Details
-
ledgerEntryType
- Specified by:
ledgerEntryTypein interfaceMpTokenObject- Returns:
- The computed-at-construction value of the
ledgerEntryTypeattribute
-
flags
TheMpTokenFlagsfor this token.- Specified by:
flagsin interfaceMpTokenObject- Returns:
- An
MpTokenFlags.
-
account
TheAddressof the owner of this MPToken.- Specified by:
accountin interfaceMpTokenObject- Returns:
- An
Address.
-
mpTokenIssuanceId
TheMpTokenIssuanceIdof the MPTokenIssuance that this token corresponds to.- Specified by:
mpTokenIssuanceIdin interfaceMpTokenObject- Returns:
- An
MpTokenIssuanceId.
-
mptAmount
The balance of this MPToken. Defaults to 0.- Specified by:
mptAmountin interfaceMpTokenObject- Returns:
- An
MpTokenNumericAmount.
-
lockedAmount
The amount of this MPToken that is locked in escrows. This field tracks the total amount held in escrows for this specific holder.- Specified by:
lockedAmountin interfaceMpTokenObject- Returns:
- An optionally-present
MpTokenNumericAmount.
-
previousTransactionId
The identifying hash of the transaction that most recently modified this object.- Specified by:
previousTransactionIdin interfaceMpTokenObject- Returns:
- A
Hash256containing the previous transaction hash.
-
previousTransactionLedgerSequence
public com.google.common.primitives.UnsignedInteger previousTransactionLedgerSequence()The index of the ledger that contains the transaction that most recently modified this object.- Specified by:
previousTransactionLedgerSequencein interfaceMpTokenObject- Returns:
- An
UnsignedIntegerrepresenting the previous transaction ledger sequence.
-
ownerNode
A hint indicating which page of the owner directory links to this object, in case the directory consists of multiple pages.Note: The object does not contain a direct link to the owner directory containing it, since that value can be derived from the Account.
- Specified by:
ownerNodein interfaceMpTokenObject- Returns:
- An
Optionalof typeStringcontaining the owner node hint.
-
index
The unique ID of thisMpTokenObject.- Specified by:
indexin interfaceMpTokenObject- Returns:
- A
Hash256containing the ID.
-
withFlags
Copy the current immutable object by setting a value for theflagsattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for flags- Returns:
- A modified copy of the
thisobject
-
withAccount
Copy the current immutable object by setting a value for theaccountattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for account- Returns:
- A modified copy of the
thisobject
-
withMpTokenIssuanceId
Copy the current immutable object by setting a value for thempTokenIssuanceIdattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for mpTokenIssuanceId- Returns:
- A modified copy of the
thisobject
-
withMptAmount
Copy the current immutable object by setting a value for themptAmountattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for mptAmount- Returns:
- A modified copy of the
thisobject
-
withLockedAmount
Copy the current immutable object by setting a present value for the optionallockedAmountattribute.- Parameters:
value- The value for lockedAmount- Returns:
- A modified copy of
thisobject
-
withLockedAmount
public final ImmutableMpTokenObject withLockedAmount(Optional<? extends MpTokenNumericAmount> optional) Copy the current immutable object by setting an optional value for thelockedAmountattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for lockedAmount- Returns:
- A modified copy of
thisobject
-
withPreviousTransactionId
Copy the current immutable object by setting a value for thepreviousTransactionIdattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for previousTransactionId- Returns:
- A modified copy of the
thisobject
-
withPreviousTransactionLedgerSequence
public final ImmutableMpTokenObject withPreviousTransactionLedgerSequence(com.google.common.primitives.UnsignedInteger value) Copy the current immutable object by setting a value for thepreviousTransactionLedgerSequenceattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for previousTransactionLedgerSequence- Returns:
- A modified copy of the
thisobject
-
withOwnerNode
Copy the current immutable object by setting a present value for the optionalownerNodeattribute.- Parameters:
value- The value for ownerNode- Returns:
- A modified copy of
thisobject
-
withOwnerNode
Copy the current immutable object by setting an optional value for theownerNodeattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for ownerNode- Returns:
- A modified copy of
thisobject
-
withIndex
Copy the current immutable object by setting a value for theindexattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for index- Returns:
- A modified copy of the
thisobject
-
equals
This instance is equal to all instances ofImmutableMpTokenObjectthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:ledgerEntryType,flags,account,mpTokenIssuanceId,mptAmount,lockedAmount,previousTransactionId,previousTransactionLedgerSequence,ownerNode,index. -
toString
Prints the immutable valueMpTokenObjectwith attribute values. -
copyOf
Creates an immutable copy of aMpTokenObjectvalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable MpTokenObject instance
-
builder
Creates a builder forImmutableMpTokenObject.ImmutableMpTokenObject.builder() .flags(org.xrpl.xrpl4j.model.flags.MpTokenFlags) // requiredflags.account(org.xrpl.xrpl4j.model.transactions.Address) // requiredaccount.mpTokenIssuanceId(org.xrpl.xrpl4j.model.transactions.MpTokenIssuanceId) // requiredmpTokenIssuanceId.mptAmount(org.xrpl.xrpl4j.model.transactions.MpTokenNumericAmount) // optionalmptAmount.lockedAmount(org.xrpl.xrpl4j.model.transactions.MpTokenNumericAmount) // optionallockedAmount.previousTransactionId(org.xrpl.xrpl4j.model.transactions.Hash256) // requiredpreviousTransactionId.previousTransactionLedgerSequence(com.google.common.primitives.UnsignedInteger) // requiredpreviousTransactionLedgerSequence.ownerNode(String) // optionalownerNode.index(org.xrpl.xrpl4j.model.transactions.Hash256) // requiredindex.build();- Returns:
- A new ImmutableMpTokenObject builder
-