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().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableIssuedCurrencyAmount. -
Field Summary
Fields inherited from interface org.xrpl.xrpl4j.model.transactions.CurrencyAmount
MAX_XRP, MAX_XRP_BD, MAX_XRP_IN_DROPS, ONE_XRP_IN_DROPSFields inherited from interface org.xrpl.xrpl4j.model.transactions.IssuedCurrencyAmount
MAX_NEGATIVE_VALUE, MAX_VALUE, MIN_POSITIVE_VALUE, MIN_VALUE -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forImmutableIssuedCurrencyAmount.copyOf(IssuedCurrencyAmount instance) Creates an immutable copy of aIssuedCurrencyAmountvalue.currency()Arbitrary code for currency to issue.booleanThis instance is equal to all instances ofImmutableIssuedCurrencyAmountthat have equal attribute values.inthashCode()Computes a hash code from attributes:value,currency,issuer.booleanIndicates whether this amount is positive or negative.issuer()Unique accountAddressof the entity issuing the currency.toString()Prints the immutable valueIssuedCurrencyAmountwith attribute values.value()Quoted decimal representation of the amount of currency.withCurrency(String value) Copy the current immutable object by setting a value for thecurrencyattribute.withIssuer(Address value) Copy the current immutable object by setting a value for theissuerattribute.Copy the current immutable object by setting a value for thevalueattribute.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.xrpl.xrpl4j.model.transactions.CurrencyAmount
handle, map
-
Method Details
-
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 aStringwith 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:
valuein interfaceIssuedCurrencyAmount- Returns:
- A
Stringcontaining the amount of this issued currency.
-
currency
Arbitrary code for currency to issue. Cannot be XRP.- Specified by:
currencyin interfaceIssuedCurrencyAmount- Returns:
- A
Stringcontaining the currency code.
-
issuer
Unique accountAddressof the entity issuing the currency. In other words, the person or business where the currency can be redeemed.- Specified by:
issuerin interfaceIssuedCurrencyAmount- Returns:
- The
Addressof the account of the issuer of this currency.
-
isNegative
public boolean isNegative()Indicates whether this amount is positive or negative.- Specified by:
isNegativein interfaceCurrencyAmount- Specified by:
isNegativein interfaceIssuedCurrencyAmount- Returns:
trueif this amount is negative;falseotherwise (i.e., if the value is 0 or positive).
-
withValue
Copy the current immutable object by setting a value for thevalueattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for value- Returns:
- A modified copy of the
thisobject
-
withCurrency
Copy the current immutable object by setting a value for thecurrencyattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for currency- Returns:
- A modified copy of the
thisobject
-
withIssuer
Copy the current immutable object by setting a value for theissuerattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for issuer- Returns:
- A modified copy of the
thisobject
-
equals
This instance is equal to all instances ofImmutableIssuedCurrencyAmountthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:value,currency,issuer. -
toString
Prints the immutable valueIssuedCurrencyAmountwith attribute values. -
copyOf
Creates an immutable copy of aIssuedCurrencyAmountvalue. 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
Creates a builder forImmutableIssuedCurrencyAmount.ImmutableIssuedCurrencyAmount.builder() .value(String) // requiredvalue.currency(String) // requiredcurrency.issuer(org.xrpl.xrpl4j.model.transactions.Address) // requiredissuer.build();- Returns:
- A new ImmutableIssuedCurrencyAmount builder
-