Class ImmutableMptCurrencyAmount

java.lang.Object
org.xrpl.xrpl4j.model.transactions.ImmutableMptCurrencyAmount
All Implemented Interfaces:
CurrencyAmount, MptCurrencyAmount

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

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

  • Method Details

    • mptIssuanceId

      public MpTokenIssuanceId mptIssuanceId()
      Specified by:
      mptIssuanceId in interface MptCurrencyAmount
      Returns:
      The value of the mptIssuanceId attribute
    • value

      public String value()
      Specified by:
      value in interface MptCurrencyAmount
      Returns:
      The value of the value attribute
    • isNegative

      public boolean isNegative()
      Indicates whether this amount is positive or negative.
      Specified by:
      isNegative in interface CurrencyAmount
      Specified by:
      isNegative in interface MptCurrencyAmount
      Returns:
      true if this amount is negative; false otherwise (i.e., if the value is 0 or positive).
    • withMptIssuanceId

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

      public final ImmutableMptCurrencyAmount withValue(String value)
      Copy the current immutable object by setting a value for the value attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for value
      Returns:
      A modified copy of the this object
    • equals

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

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

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

      public static ImmutableMptCurrencyAmount.Builder builder()
      Creates a builder for ImmutableMptCurrencyAmount.
       ImmutableMptCurrencyAmount.builder()
          .mptIssuanceId(org.xrpl.xrpl4j.model.transactions.MpTokenIssuanceId) // required mptIssuanceId
          .value(String) // required value
          .build();
       
      Returns:
      A new ImmutableMptCurrencyAmount builder