Class ImmutableAccountCurrenciesResult
- java.lang.Object
-
- org.xrpl.xrpl4j.model.client.accounts.ImmutableAccountCurrenciesResult
-
- All Implemented Interfaces:
AccountCurrenciesResult
,XrplResult
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableAccountCurrenciesResult extends Object implements AccountCurrenciesResult
Immutable implementation ofAccountCurrenciesResult
.Use the builder to create immutable instances:
ImmutableAccountCurrenciesResult.builder()
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ImmutableAccountCurrenciesResult.Builder
Builds instances of typeImmutableAccountCurrenciesResult
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static ImmutableAccountCurrenciesResult.Builder
builder()
Creates a builder forImmutableAccountCurrenciesResult
.static ImmutableAccountCurrenciesResult
copyOf(AccountCurrenciesResult instance)
Creates an immutable copy of aAccountCurrenciesResult
value.boolean
equals(Object another)
This instance is equal to all instances ofImmutableAccountCurrenciesResult
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:status
,ledgerHash
,ledgerIndex
,ledgerCurrentIndex
,validated
,receiveCurrencies
,sendCurrencies
.Optional<LedgerIndex>
ledgerCurrentIndex()
The ledger index of the current open ledger, which was used when retrieving this information.Optional<Hash256>
ledgerHash()
The identifying Hash of the ledger version used to generate this response.LedgerIndex
ledgerIndex()
Deprecated.When requesting Account Channels from a non-validated ledger, the result will not contain this field.com.google.common.collect.ImmutableList<String>
receiveCurrencies()
Array of currency codes for currencies that this account can receive.com.google.common.collect.ImmutableList<String>
sendCurrencies()
Array of currency codes for currencies that this account can send.Optional<String>
status()
The value"success"
indicates the request was successfully received and understood by the server.String
toString()
Prints the immutable valueAccountCurrenciesResult
with attribute values.boolean
validated()
If true, the information in this response comes from a validated ledger version.ImmutableAccountCurrenciesResult
withLedgerCurrentIndex(Optional<? extends LedgerIndex> optional)
Copy the current immutable object by setting an optional value for theledgerCurrentIndex
attribute.ImmutableAccountCurrenciesResult
withLedgerCurrentIndex(LedgerIndex value)
Copy the current immutable object by setting a present value for the optionalledgerCurrentIndex
attribute.ImmutableAccountCurrenciesResult
withLedgerHash(Optional<? extends Hash256> optional)
Copy the current immutable object by setting an optional value for theledgerHash
attribute.ImmutableAccountCurrenciesResult
withLedgerHash(Hash256 value)
Copy the current immutable object by setting a present value for the optionalledgerHash
attribute.ImmutableAccountCurrenciesResult
withLedgerIndex(LedgerIndex value)
Deprecated.ImmutableAccountCurrenciesResult
withReceiveCurrencies(Iterable<String> elements)
Copy the current immutable object with elements that replace the content ofreceiveCurrencies
.ImmutableAccountCurrenciesResult
withReceiveCurrencies(String... elements)
Copy the current immutable object with elements that replace the content ofreceiveCurrencies
.ImmutableAccountCurrenciesResult
withSendCurrencies(Iterable<String> elements)
Copy the current immutable object with elements that replace the content ofsendCurrencies
.ImmutableAccountCurrenciesResult
withSendCurrencies(String... elements)
Copy the current immutable object with elements that replace the content ofsendCurrencies
.ImmutableAccountCurrenciesResult
withStatus(String value)
Copy the current immutable object by setting a present value for the optionalstatus
attribute.ImmutableAccountCurrenciesResult
withStatus(Optional<String> optional)
Copy the current immutable object by setting an optional value for thestatus
attribute.ImmutableAccountCurrenciesResult
withValidated(boolean value)
Copy the current immutable object by setting a value for thevalidated
attribute.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.xrpl.xrpl4j.model.client.accounts.AccountCurrenciesResult
ledgerCurrentIndexSafe, ledgerHashSafe, ledgerIndexSafe
-
-
-
-
Method Detail
-
status
public Optional<String> status()
The value"success"
indicates the request was successfully received and understood by the server.- Specified by:
status
in interfaceXrplResult
- Returns:
- The
String
"success"
if the request was successful, otherwiseOptional.empty()
.
-
ledgerHash
public Optional<Hash256> ledgerHash()
The identifying Hash of the ledger version used to generate this response.- Specified by:
ledgerHash
in interfaceAccountCurrenciesResult
- Returns:
- A
Hash256
containing the ledger hash.
-
ledgerIndex
@Deprecated @Nullable public LedgerIndex ledgerIndex()
Deprecated.When requesting Account Channels from a non-validated ledger, the result will not contain this field. To prevent this class from throwing an error when requesting Account Currencies from a non-validated ledger, this field is currently marked asNullable
. However, this field will beOptional
in a future release.The Ledger Index of the ledger version used to generate this response.- Specified by:
ledgerIndex
in interfaceAccountCurrenciesResult
- Returns:
- A
LedgerIndex
.
-
ledgerCurrentIndex
public Optional<LedgerIndex> ledgerCurrentIndex()
The ledger index of the current open ledger, which was used when retrieving this information. Only present in responses to requests with ledger_index = "current".- Specified by:
ledgerCurrentIndex
in interfaceAccountCurrenciesResult
- Returns:
- An optionally-present
LedgerIndex
representing the current ledger index.
-
validated
public boolean validated()
If true, the information in this response comes from a validated ledger version. Otherwise, the information is subject to change.- Specified by:
validated
in interfaceAccountCurrenciesResult
- Returns:
true
if the information in this response comes from a validated ledger version,false
if not.
-
receiveCurrencies
public com.google.common.collect.ImmutableList<String> receiveCurrencies()
Array of currency codes for currencies that this account can receive.- Specified by:
receiveCurrencies
in interfaceAccountCurrenciesResult
- Returns:
- Array of currencies that this account can receive.
-
sendCurrencies
public com.google.common.collect.ImmutableList<String> sendCurrencies()
Array of currency codes for currencies that this account can send.- Specified by:
sendCurrencies
in interfaceAccountCurrenciesResult
- Returns:
- Array of currencies that this account can send.
-
withStatus
public final ImmutableAccountCurrenciesResult withStatus(String value)
Copy the current immutable object by setting a present value for the optionalstatus
attribute.- Parameters:
value
- The value for status- Returns:
- A modified copy of
this
object
-
withStatus
public final ImmutableAccountCurrenciesResult withStatus(Optional<String> optional)
Copy the current immutable object by setting an optional value for thestatus
attribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis
.- Parameters:
optional
- A value for status- Returns:
- A modified copy of
this
object
-
withLedgerHash
public final ImmutableAccountCurrenciesResult withLedgerHash(Hash256 value)
Copy the current immutable object by setting a present value for the optionalledgerHash
attribute.- Parameters:
value
- The value for ledgerHash- Returns:
- A modified copy of
this
object
-
withLedgerHash
public final ImmutableAccountCurrenciesResult withLedgerHash(Optional<? extends Hash256> optional)
Copy the current immutable object by setting an optional value for theledgerHash
attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis
.- Parameters:
optional
- A value for ledgerHash- Returns:
- A modified copy of
this
object
-
withLedgerIndex
@Deprecated public final ImmutableAccountCurrenciesResult withLedgerIndex(@Nullable LedgerIndex value)
Deprecated.Copy the current immutable object by setting a value for theledgerIndex
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for ledgerIndex (can benull
)- Returns:
- A modified copy of the
this
object
-
withLedgerCurrentIndex
public final ImmutableAccountCurrenciesResult withLedgerCurrentIndex(LedgerIndex value)
Copy the current immutable object by setting a present value for the optionalledgerCurrentIndex
attribute.- Parameters:
value
- The value for ledgerCurrentIndex- Returns:
- A modified copy of
this
object
-
withLedgerCurrentIndex
public final ImmutableAccountCurrenciesResult withLedgerCurrentIndex(Optional<? extends LedgerIndex> optional)
Copy the current immutable object by setting an optional value for theledgerCurrentIndex
attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis
.- Parameters:
optional
- A value for ledgerCurrentIndex- Returns:
- A modified copy of
this
object
-
withValidated
public final ImmutableAccountCurrenciesResult withValidated(boolean value)
Copy the current immutable object by setting a value for thevalidated
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for validated- Returns:
- A modified copy of the
this
object
-
withReceiveCurrencies
public final ImmutableAccountCurrenciesResult withReceiveCurrencies(String... elements)
Copy the current immutable object with elements that replace the content ofreceiveCurrencies
.- Parameters:
elements
- The elements to set- Returns:
- A modified copy of
this
object
-
withReceiveCurrencies
public final ImmutableAccountCurrenciesResult withReceiveCurrencies(Iterable<String> elements)
Copy the current immutable object with elements that replace the content ofreceiveCurrencies
. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
elements
- An iterable of receiveCurrencies elements to set- Returns:
- A modified copy of
this
object
-
withSendCurrencies
public final ImmutableAccountCurrenciesResult withSendCurrencies(String... elements)
Copy the current immutable object with elements that replace the content ofsendCurrencies
.- Parameters:
elements
- The elements to set- Returns:
- A modified copy of
this
object
-
withSendCurrencies
public final ImmutableAccountCurrenciesResult withSendCurrencies(Iterable<String> elements)
Copy the current immutable object with elements that replace the content ofsendCurrencies
. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
elements
- An iterable of sendCurrencies elements to set- Returns:
- A modified copy of
this
object
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutableAccountCurrenciesResult
that have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:status
,ledgerHash
,ledgerIndex
,ledgerCurrentIndex
,validated
,receiveCurrencies
,sendCurrencies
.
-
toString
public String toString()
Prints the immutable valueAccountCurrenciesResult
with attribute values.
-
copyOf
public static ImmutableAccountCurrenciesResult copyOf(AccountCurrenciesResult instance)
Creates an immutable copy of aAccountCurrenciesResult
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 AccountCurrenciesResult instance
-
builder
public static ImmutableAccountCurrenciesResult.Builder builder()
Creates a builder forImmutableAccountCurrenciesResult
.ImmutableAccountCurrenciesResult.builder() .status(String) // optional
status
.ledgerHash(org.xrpl.xrpl4j.model.transactions.Hash256) // optionalledgerHash
.ledgerIndex(org.xrpl.xrpl4j.model.client.common.LedgerIndex | null) // nullableledgerIndex
.ledgerCurrentIndex(org.xrpl.xrpl4j.model.client.common.LedgerIndex) // optionalledgerCurrentIndex
.validated(boolean) // requiredvalidated
.addReceiveCurrencies|addAllReceiveCurrencies(String) //receiveCurrencies
elements .addSendCurrencies|addAllSendCurrencies(String) //sendCurrencies
elements .build();- Returns:
- A new ImmutableAccountCurrenciesResult builder
-
-