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().

  • Method Details

    • ledgerEntryType

      public LedgerObject.LedgerEntryType ledgerEntryType()
      Specified by:
      ledgerEntryType in interface MpTokenObject
      Returns:
      The computed-at-construction value of the ledgerEntryType attribute
    • flags

      public MpTokenFlags flags()
      The MpTokenFlags for this token.
      Specified by:
      flags in interface MpTokenObject
      Returns:
      An MpTokenFlags.
    • account

      public Address account()
      The Address of the owner of this MPToken.
      Specified by:
      account in interface MpTokenObject
      Returns:
      An Address.
    • mpTokenIssuanceId

      public MpTokenIssuanceId mpTokenIssuanceId()
      The MpTokenIssuanceId of the MPTokenIssuance that this token corresponds to.
      Specified by:
      mpTokenIssuanceId in interface MpTokenObject
      Returns:
      An MpTokenIssuanceId.
    • mptAmount

      public MpTokenNumericAmount mptAmount()
      The balance of this MPToken. Defaults to 0.
      Specified by:
      mptAmount in interface MpTokenObject
      Returns:
      An MpTokenNumericAmount.
    • lockedAmount

      public Optional<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:
      lockedAmount in interface MpTokenObject
      Returns:
      An optionally-present MpTokenNumericAmount.
    • previousTransactionId

      public Hash256 previousTransactionId()
      The identifying hash of the transaction that most recently modified this object.
      Specified by:
      previousTransactionId in interface MpTokenObject
      Returns:
      A Hash256 containing 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:
      previousTransactionLedgerSequence in interface MpTokenObject
      Returns:
      An UnsignedInteger representing the previous transaction ledger sequence.
    • ownerNode

      public Optional<String> 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:
      ownerNode in interface MpTokenObject
      Returns:
      An Optional of type String containing the owner node hint.
    • index

      public Hash256 index()
      The unique ID of this MpTokenObject.
      Specified by:
      index in interface MpTokenObject
      Returns:
      A Hash256 containing the ID.
    • withFlags

      public final ImmutableMpTokenObject withFlags(MpTokenFlags value)
      Copy the current immutable object by setting a value for the flags attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for flags
      Returns:
      A modified copy of the this object
    • withAccount

      public final ImmutableMpTokenObject withAccount(Address value)
      Copy the current immutable object by setting a value for the account attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for account
      Returns:
      A modified copy of the this object
    • withMpTokenIssuanceId

      public final ImmutableMpTokenObject withMpTokenIssuanceId(MpTokenIssuanceId value)
      Copy the current immutable object by setting a value for the mpTokenIssuanceId attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for mpTokenIssuanceId
      Returns:
      A modified copy of the this object
    • withMptAmount

      public final ImmutableMpTokenObject withMptAmount(MpTokenNumericAmount value)
      Copy the current immutable object by setting a value for the mptAmount attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for mptAmount
      Returns:
      A modified copy of the this object
    • withLockedAmount

      public final ImmutableMpTokenObject withLockedAmount(MpTokenNumericAmount value)
      Copy the current immutable object by setting a present value for the optional lockedAmount attribute.
      Parameters:
      value - The value for lockedAmount
      Returns:
      A modified copy of this object
    • withLockedAmount

      public final ImmutableMpTokenObject withLockedAmount(Optional<? extends MpTokenNumericAmount> optional)
      Copy the current immutable object by setting an optional value for the lockedAmount attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for lockedAmount
      Returns:
      A modified copy of this object
    • withPreviousTransactionId

      public final ImmutableMpTokenObject withPreviousTransactionId(Hash256 value)
      Copy the current immutable object by setting a value for the previousTransactionId attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for previousTransactionId
      Returns:
      A modified copy of the this object
    • withPreviousTransactionLedgerSequence

      public final ImmutableMpTokenObject withPreviousTransactionLedgerSequence(com.google.common.primitives.UnsignedInteger value)
      Copy the current immutable object by setting a value for the previousTransactionLedgerSequence attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for previousTransactionLedgerSequence
      Returns:
      A modified copy of the this object
    • withOwnerNode

      public final ImmutableMpTokenObject withOwnerNode(String value)
      Copy the current immutable object by setting a present value for the optional ownerNode attribute.
      Parameters:
      value - The value for ownerNode
      Returns:
      A modified copy of this object
    • withOwnerNode

      public final ImmutableMpTokenObject withOwnerNode(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the ownerNode attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for ownerNode
      Returns:
      A modified copy of this object
    • withIndex

      public final ImmutableMpTokenObject withIndex(Hash256 value)
      Copy the current immutable object by setting a value for the index attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for index
      Returns:
      A modified copy of the this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableMpTokenObject that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: ledgerEntryType, flags, account, mpTokenIssuanceId, mptAmount, lockedAmount, previousTransactionId, previousTransactionLedgerSequence, ownerNode, index.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value MpTokenObject with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • copyOf

      public static ImmutableMpTokenObject copyOf(MpTokenObject instance)
      Creates an immutable copy of a MpTokenObject value. 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

      public static ImmutableMpTokenObject.Builder builder()
      Creates a builder for ImmutableMpTokenObject.
       ImmutableMpTokenObject.builder()
          .flags(org.xrpl.xrpl4j.model.flags.MpTokenFlags) // required flags
          .account(org.xrpl.xrpl4j.model.transactions.Address) // required account
          .mpTokenIssuanceId(org.xrpl.xrpl4j.model.transactions.MpTokenIssuanceId) // required mpTokenIssuanceId
          .mptAmount(org.xrpl.xrpl4j.model.transactions.MpTokenNumericAmount) // optional mptAmount
          .lockedAmount(org.xrpl.xrpl4j.model.transactions.MpTokenNumericAmount) // optional lockedAmount
          .previousTransactionId(org.xrpl.xrpl4j.model.transactions.Hash256) // required previousTransactionId
          .previousTransactionLedgerSequence(com.google.common.primitives.UnsignedInteger) // required previousTransactionLedgerSequence
          .ownerNode(String) // optional ownerNode
          .index(org.xrpl.xrpl4j.model.transactions.Hash256) // required index
          .build();
       
      Returns:
      A new ImmutableMpTokenObject builder