Class ImmutableIssuedCurrencyAmount

java.lang.Object
org.xrpl.xrpl4j.model.transactions.ImmutableIssuedCurrencyAmount
All Implemented Interfaces:
CurrencyAmount, IssuedCurrencyAmount

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

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

  • Method Details

    • value

      public String value()
      Quoted decimal representation of the amount of currency. This can include scientific notation, such as 1.23e11 meaning 123,000,000,000. Both e and E may be used. Note that while this implementation merely holds a String with no value restrictions, the XRP Ledger does not tolerate unlimited precision values. Instead, non-XRP values (i.e., values held in this object) can have up to 16 decimal digits of precision, with a maximum value of 9999999999999999e80. The smallest positive non-XRP value is 1e-81.
      Specified by:
      value in interface IssuedCurrencyAmount
      Returns:
      A String containing the amount of this issued currency.
    • currency

      public String currency()
      Arbitrary code for currency to issue. Cannot be XRP.
      Specified by:
      currency in interface IssuedCurrencyAmount
      Returns:
      A String containing the currency code.
    • issuer

      public Address issuer()
      Unique account Address of the entity issuing the currency. In other words, the person or business where the currency can be redeemed.
      Specified by:
      issuer in interface IssuedCurrencyAmount
      Returns:
      The Address of the account of the issuer of this currency.
    • isNegative

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

      public final ImmutableIssuedCurrencyAmount 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
    • withCurrency

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

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

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

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

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

      public static ImmutableIssuedCurrencyAmount.Builder builder()
      Creates a builder for ImmutableIssuedCurrencyAmount.
       ImmutableIssuedCurrencyAmount.builder()
          .value(String) // required value
          .currency(String) // required currency
          .issuer(org.xrpl.xrpl4j.model.transactions.Address) // required issuer
          .build();
       
      Returns:
      A new ImmutableIssuedCurrencyAmount builder