Class ImmutableRipplePathFindRequestParams
- java.lang.Object
-
- org.xrpl.xrpl4j.model.client.path.ImmutableRipplePathFindRequestParams
-
- All Implemented Interfaces:
RipplePathFindRequestParams
,XrplRequestParams
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableRipplePathFindRequestParams extends Object implements RipplePathFindRequestParams
Immutable implementation ofRipplePathFindRequestParams
.Use the builder to create immutable instances:
ImmutableRipplePathFindRequestParams.builder()
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ImmutableRipplePathFindRequestParams.Builder
Builds instances of typeImmutableRipplePathFindRequestParams
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static ImmutableRipplePathFindRequestParams.Builder
builder()
Creates a builder forImmutableRipplePathFindRequestParams
.static ImmutableRipplePathFindRequestParams
copyOf(RipplePathFindRequestParams instance)
Creates an immutable copy of aRipplePathFindRequestParams
value.Address
destinationAccount()
UniqueAddress
of the account that would receive funds in a transaction.CurrencyAmount
destinationAmount()
CurrencyAmount
that the destination account would receive in a transaction.boolean
equals(Object another)
This instance is equal to all instances ofImmutableRipplePathFindRequestParams
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:sourceAccount
,destinationAccount
,destinationAmount
,sendMax
,sourceCurrencies
,ledgerSpecifier
.Optional<Hash256>
ledgerHash()
Deprecated.Ledger hash should be specified inledgerSpecifier()
.LedgerIndex
ledgerIndex()
Deprecated.Ledger index and any shortcut values should be specified inledgerSpecifier()
.LedgerSpecifier
ledgerSpecifier()
Specifies the ledger version to request.Optional<CurrencyAmount>
sendMax()
CurrencyAmount
that would be spent in the transaction.Address
sourceAccount()
UniqueAddress
of the account that would send funds in a transaction.com.google.common.collect.ImmutableList<PathCurrency>
sourceCurrencies()
AList
ofPathCurrency
that the source account might want to spend.String
toString()
Prints the immutable valueRipplePathFindRequestParams
with attribute values.ImmutableRipplePathFindRequestParams
withDestinationAccount(Address value)
Copy the current immutable object by setting a value for thedestinationAccount
attribute.ImmutableRipplePathFindRequestParams
withDestinationAmount(CurrencyAmount value)
Copy the current immutable object by setting a value for thedestinationAmount
attribute.ImmutableRipplePathFindRequestParams
withLedgerHash(Optional<? extends Hash256> optional)
Deprecated.ImmutableRipplePathFindRequestParams
withLedgerHash(Hash256 value)
Deprecated.ImmutableRipplePathFindRequestParams
withLedgerIndex(LedgerIndex value)
Deprecated.ImmutableRipplePathFindRequestParams
withLedgerSpecifier(LedgerSpecifier value)
Copy the current immutable object by setting a value for theledgerSpecifier
attribute.ImmutableRipplePathFindRequestParams
withSendMax(Optional<? extends CurrencyAmount> optional)
Copy the current immutable object by setting an optional value for thesendMax
attribute.ImmutableRipplePathFindRequestParams
withSendMax(CurrencyAmount value)
Copy the current immutable object by setting a present value for the optionalsendMax
attribute.ImmutableRipplePathFindRequestParams
withSourceAccount(Address value)
Copy the current immutable object by setting a value for thesourceAccount
attribute.ImmutableRipplePathFindRequestParams
withSourceCurrencies(Iterable<? extends PathCurrency> elements)
Copy the current immutable object with elements that replace the content ofsourceCurrencies
.ImmutableRipplePathFindRequestParams
withSourceCurrencies(PathCurrency... elements)
Copy the current immutable object with elements that replace the content ofsourceCurrencies
.
-
-
-
Method Detail
-
sourceAccount
public Address sourceAccount()
UniqueAddress
of the account that would send funds in a transaction.- Specified by:
sourceAccount
in interfaceRipplePathFindRequestParams
- Returns:
- The unique
Address
of the source account.
-
destinationAccount
public Address destinationAccount()
UniqueAddress
of the account that would receive funds in a transaction.- Specified by:
destinationAccount
in interfaceRipplePathFindRequestParams
- Returns:
- The unique
Address
of the destination account.
-
destinationAmount
public CurrencyAmount destinationAmount()
CurrencyAmount
that the destination account would receive in a transaction.Special case: You can specify "-1" (for XRP) or provide "-1" as the contents of
IssuedCurrencyAmount.value()
(for non-XRP currencies). This requests a path to deliver as much as possible, while spending no more than the amount specified insendMax()
(if provided).- Specified by:
destinationAmount
in interfaceRipplePathFindRequestParams
- Returns:
- A
CurrencyAmount
denoting the destination amount.
-
sendMax
public Optional<CurrencyAmount> sendMax()
CurrencyAmount
that would be spent in the transaction. Cannot be used withsourceCurrencies()
.- Specified by:
sendMax
in interfaceRipplePathFindRequestParams
- Returns:
- A
CurrencyAmount
denoting the send max.
-
sourceCurrencies
public com.google.common.collect.ImmutableList<PathCurrency> sourceCurrencies()
AList
ofPathCurrency
that the source account might want to spend.Cannot contain more than 18 source currencies.
- Specified by:
sourceCurrencies
in interfaceRipplePathFindRequestParams
- Returns:
- A
List
ofPathCurrency
containing all of the source currencies.
-
ledgerHash
@Deprecated public Optional<Hash256> ledgerHash()
Deprecated.Ledger hash should be specified inledgerSpecifier()
.A 20-byte hex string for the ledger version to use.- Specified by:
ledgerHash
in interfaceRipplePathFindRequestParams
- Returns:
- An optionally-present
Hash256
.
-
ledgerIndex
@Deprecated @Nullable public LedgerIndex ledgerIndex()
Deprecated.Ledger index and any shortcut values should be specified inledgerSpecifier()
.The ledger index of the ledger to use, or a shortcut string to choose a ledger automatically.- Specified by:
ledgerIndex
in interfaceRipplePathFindRequestParams
- Returns:
- A
LedgerIndex
. Defaults toLedgerIndex.CURRENT
.
-
ledgerSpecifier
public LedgerSpecifier ledgerSpecifier()
Specifies the ledger version to request. A ledger version can be specified by ledger hash, numerical ledger index, or a shortcut value.- Specified by:
ledgerSpecifier
in interfaceRipplePathFindRequestParams
- Returns:
- A
LedgerSpecifier
specifying the ledger version to request.
-
withSourceAccount
public final ImmutableRipplePathFindRequestParams withSourceAccount(Address value)
Copy the current immutable object by setting a value for thesourceAccount
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for sourceAccount- Returns:
- A modified copy of the
this
object
-
withDestinationAccount
public final ImmutableRipplePathFindRequestParams withDestinationAccount(Address value)
Copy the current immutable object by setting a value for thedestinationAccount
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for destinationAccount- Returns:
- A modified copy of the
this
object
-
withDestinationAmount
public final ImmutableRipplePathFindRequestParams withDestinationAmount(CurrencyAmount value)
Copy the current immutable object by setting a value for thedestinationAmount
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for destinationAmount- Returns:
- A modified copy of the
this
object
-
withSendMax
public final ImmutableRipplePathFindRequestParams withSendMax(CurrencyAmount value)
Copy the current immutable object by setting a present value for the optionalsendMax
attribute.- Parameters:
value
- The value for sendMax- Returns:
- A modified copy of
this
object
-
withSendMax
public final ImmutableRipplePathFindRequestParams withSendMax(Optional<? extends CurrencyAmount> optional)
Copy the current immutable object by setting an optional value for thesendMax
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 sendMax- Returns:
- A modified copy of
this
object
-
withSourceCurrencies
public final ImmutableRipplePathFindRequestParams withSourceCurrencies(PathCurrency... elements)
Copy the current immutable object with elements that replace the content ofsourceCurrencies
.- Parameters:
elements
- The elements to set- Returns:
- A modified copy of
this
object
-
withSourceCurrencies
public final ImmutableRipplePathFindRequestParams withSourceCurrencies(Iterable<? extends PathCurrency> elements)
Copy the current immutable object with elements that replace the content ofsourceCurrencies
. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
elements
- An iterable of sourceCurrencies elements to set- Returns:
- A modified copy of
this
object
-
withLedgerHash
@Deprecated public final ImmutableRipplePathFindRequestParams withLedgerHash(Hash256 value)
Deprecated.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
@Deprecated public final ImmutableRipplePathFindRequestParams withLedgerHash(Optional<? extends Hash256> optional)
Deprecated.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 ImmutableRipplePathFindRequestParams 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
-
withLedgerSpecifier
public final ImmutableRipplePathFindRequestParams withLedgerSpecifier(LedgerSpecifier value)
Copy the current immutable object by setting a value for theledgerSpecifier
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for ledgerSpecifier- Returns:
- A modified copy of the
this
object
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutableRipplePathFindRequestParams
that have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:sourceAccount
,destinationAccount
,destinationAmount
,sendMax
,sourceCurrencies
,ledgerSpecifier
.
-
toString
public String toString()
Prints the immutable valueRipplePathFindRequestParams
with attribute values.
-
copyOf
public static ImmutableRipplePathFindRequestParams copyOf(RipplePathFindRequestParams instance)
Creates an immutable copy of aRipplePathFindRequestParams
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 RipplePathFindRequestParams instance
-
builder
public static ImmutableRipplePathFindRequestParams.Builder builder()
Creates a builder forImmutableRipplePathFindRequestParams
.ImmutableRipplePathFindRequestParams.builder() .sourceAccount(org.xrpl.xrpl4j.model.transactions.Address) // required
sourceAccount
.destinationAccount(org.xrpl.xrpl4j.model.transactions.Address) // requireddestinationAccount
.destinationAmount(org.xrpl.xrpl4j.model.transactions.CurrencyAmount) // requireddestinationAmount
.sendMax(org.xrpl.xrpl4j.model.transactions.CurrencyAmount) // optionalsendMax
.addSourceCurrencies|addAllSourceCurrencies(org.xrpl.xrpl4j.model.client.path.PathCurrency) //sourceCurrencies
elements .ledgerHash(org.xrpl.xrpl4j.model.transactions.Hash256) // optionalledgerHash
.ledgerIndex(org.xrpl.xrpl4j.model.client.common.LedgerIndex | null) // nullableledgerIndex
.ledgerSpecifier(org.xrpl.xrpl4j.model.client.common.LedgerSpecifier) // optionalledgerSpecifier
.build();- Returns:
- A new ImmutableRipplePathFindRequestParams builder
-
-