Class ImmutableMptHoldersMpToken

java.lang.Object
org.xrpl.xrpl4j.model.client.mpt.ImmutableMptHoldersMpToken
All Implemented Interfaces:
MptHoldersMpToken

@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableMptHoldersMpToken extends Object implements MptHoldersMpToken
Immutable implementation of MptHoldersMpToken.

Use the builder to create immutable instances: ImmutableMptHoldersMpToken.builder().

  • Method Details

    • account

      public Address account()
      The account that owns the MPToken.
      Specified by:
      account in interface MptHoldersMpToken
      Returns:
      An Address.
    • flags

      public MpTokenFlags flags()
      The MpTokenFlags for this MPToken.
      Specified by:
      flags in interface MptHoldersMpToken
      Returns:
      An MpTokenFlags.
    • mptAmount

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

      public Optional<MpTokenNumericAmount> lockedAmount()
      The amount of MPToken that is locked.
      Specified by:
      lockedAmount in interface MptHoldersMpToken
      Returns:
      An optionally present MpTokenNumericAmount.
    • mpTokenIndex

      public Hash256 mpTokenIndex()
      The index of this MPToken.
      Specified by:
      mpTokenIndex in interface MptHoldersMpToken
      Returns:
      A Hash256.
    • withAccount

      public final ImmutableMptHoldersMpToken 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
    • withFlags

      public final ImmutableMptHoldersMpToken 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
    • withMptAmount

      public final ImmutableMptHoldersMpToken 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 ImmutableMptHoldersMpToken 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 ImmutableMptHoldersMpToken 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
    • withMpTokenIndex

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

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableMptHoldersMpToken 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: account, flags, mptAmount, lockedAmount, mpTokenIndex.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static ImmutableMptHoldersMpToken copyOf(MptHoldersMpToken instance)
      Creates an immutable copy of a MptHoldersMpToken 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 MptHoldersMpToken instance
    • builder

      public static ImmutableMptHoldersMpToken.Builder builder()
      Creates a builder for ImmutableMptHoldersMpToken.
       ImmutableMptHoldersMpToken.builder()
          .account(org.xrpl.xrpl4j.model.transactions.Address) // required account
          .flags(org.xrpl.xrpl4j.model.flags.MpTokenFlags) // required flags
          .mptAmount(org.xrpl.xrpl4j.model.transactions.MpTokenNumericAmount) // required mptAmount
          .lockedAmount(org.xrpl.xrpl4j.model.transactions.MpTokenNumericAmount) // optional lockedAmount
          .mpTokenIndex(org.xrpl.xrpl4j.model.transactions.Hash256) // required mpTokenIndex
          .build();
       
      Returns:
      A new ImmutableMptHoldersMpToken builder