Class ImmutableLedgerRequestParams
- java.lang.Object
-
- org.xrpl.xrpl4j.model.client.ledger.ImmutableLedgerRequestParams
-
- All Implemented Interfaces:
LedgerRequestParams
,XrplRequestParams
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableLedgerRequestParams extends Object implements LedgerRequestParams
Immutable implementation ofLedgerRequestParams
.Use the builder to create immutable instances:
ImmutableLedgerRequestParams.builder()
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ImmutableLedgerRequestParams.Builder
Builds instances of typeImmutableLedgerRequestParams
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
accounts()
If true, return information on accounts in the ledger.boolean
binary()
If true, andtransactions()
andexpand()
are both also true, return transaction information in binary format (hexadecimal string) instead of JSON format.static ImmutableLedgerRequestParams.Builder
builder()
Creates a builder forImmutableLedgerRequestParams
.static ImmutableLedgerRequestParams
copyOf(LedgerRequestParams instance)
Creates an immutable copy of aLedgerRequestParams
value.boolean
equals(Object another)
This instance is equal to all instances ofImmutableLedgerRequestParams
that have equal attribute values.boolean
expand()
Provide full JSON-formatted information for transaction/account information instead of only hashes.boolean
full()
If true, return full information on the entire ledger.int
hashCode()
Computes a hash code from attributes:ledgerSpecifier
,full
,accounts
,transactions
,expand
,ownerFunds
,binary
,queue
.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.boolean
ownerFunds()
If true, include the"owner_funds"
field in the metadata ofOfferCreate
transactions in the response.boolean
queue()
If true, and the command is requesting the current ledger, includes an array of queued transactions in the results.String
toString()
Prints the immutable valueLedgerRequestParams
with attribute values.boolean
transactions()
If true, return information on transactions in the specified ledger version.ImmutableLedgerRequestParams
withAccounts(boolean value)
Copy the current immutable object by setting a value for theaccounts
attribute.ImmutableLedgerRequestParams
withFull(boolean value)
Copy the current immutable object by setting a value for thefull
attribute.ImmutableLedgerRequestParams
withLedgerHash(Optional<? extends Hash256> optional)
Deprecated.ImmutableLedgerRequestParams
withLedgerHash(Hash256 value)
Deprecated.ImmutableLedgerRequestParams
withLedgerIndex(LedgerIndex value)
Deprecated.ImmutableLedgerRequestParams
withLedgerSpecifier(LedgerSpecifier value)
Copy the current immutable object by setting a value for theledgerSpecifier
attribute.ImmutableLedgerRequestParams
withOwnerFunds(boolean value)
Copy the current immutable object by setting a value for theownerFunds
attribute.ImmutableLedgerRequestParams
withQueue(boolean value)
Copy the current immutable object by setting a value for thequeue
attribute.ImmutableLedgerRequestParams
withTransactions(boolean value)
Copy the current immutable object by setting a value for thetransactions
attribute.
-
-
-
Method Detail
-
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 interfaceLedgerRequestParams
- 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 interfaceLedgerRequestParams
- 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 interfaceLedgerRequestParams
- Returns:
- A
LedgerSpecifier
specifying the ledger version to request.
-
full
public boolean full()
If true, return full information on the entire ledger. Ignored if you did not specify aledgerHash
inledgerSpecifier()
}. Defaults to false. (Equivalent to enabling transactions, accounts, and expand.)Caution: This is a very large amount of data -- on the order of several hundred megabytes!
Note: You must be a rippled Admin to set to true.
- Specified by:
full
in interfaceLedgerRequestParams
- Returns:
true
if requesting full information on the entire ledger, otherwisefalse
. Defaults tofalse
.
-
accounts
public boolean accounts()
If true, return information on accounts in the ledger. Ignored if you did not specify aledgerHash
inledgerSpecifier()
}.Caution: This returns a very large amount of data!
Note: You must be a rippled Admin to set to true.
- Specified by:
accounts
in interfaceLedgerRequestParams
- Returns:
true
if requesting account information, otherwisefalse
. Defaults tofalse
.
-
transactions
public boolean transactions()
If true, return information on transactions in the specified ledger version. Defaults to false. Ignored if you did not specify aledgerHash
inledgerSpecifier()
}.- Specified by:
transactions
in interfaceLedgerRequestParams
- Returns:
true
if requesting transactions, otherwisefalse
. Defaults tofalse
.
-
expand
public boolean expand()
Provide full JSON-formatted information for transaction/account information instead of only hashes. Defaults to false. Ignored unless you requesttransactions()
,accounts()
, or both.- Specified by:
expand
in interfaceLedgerRequestParams
- Returns:
true
if requesting expanded transactions, otherwisefalse
. Alwaystrue
.
-
ownerFunds
public boolean ownerFunds()
If true, include the"owner_funds"
field in the metadata ofOfferCreate
transactions in the response. Defaults to false. Ignored unlesstransactions()
andexpand()
are true.- Specified by:
ownerFunds
in interfaceLedgerRequestParams
- Returns:
true
if requesting the"owner_funds"
field, otherwisefalse
. Defaults tofalse
.
-
binary
public boolean binary()
If true, andtransactions()
andexpand()
are both also true, return transaction information in binary format (hexadecimal string) instead of JSON format.- Specified by:
binary
in interfaceLedgerRequestParams
- Returns:
true
if requesting transactions in binary format, otherwisefalse
. Alwaysfalse
.
-
queue
public boolean queue()
If true, and the command is requesting the current ledger, includes an array of queued transactions in the results.- Specified by:
queue
in interfaceLedgerRequestParams
- Returns:
true
if requesting queued transactions, otherwisefalse
. Defaults tofalse
.
-
withLedgerHash
@Deprecated public final ImmutableLedgerRequestParams 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 ImmutableLedgerRequestParams 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 ImmutableLedgerRequestParams 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 ImmutableLedgerRequestParams 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
-
withFull
public final ImmutableLedgerRequestParams withFull(boolean value)
Copy the current immutable object by setting a value for thefull
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for full- Returns:
- A modified copy of the
this
object
-
withAccounts
public final ImmutableLedgerRequestParams withAccounts(boolean value)
Copy the current immutable object by setting a value for theaccounts
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for accounts- Returns:
- A modified copy of the
this
object
-
withTransactions
public final ImmutableLedgerRequestParams withTransactions(boolean value)
Copy the current immutable object by setting a value for thetransactions
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for transactions- Returns:
- A modified copy of the
this
object
-
withOwnerFunds
public final ImmutableLedgerRequestParams withOwnerFunds(boolean value)
Copy the current immutable object by setting a value for theownerFunds
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for ownerFunds- Returns:
- A modified copy of the
this
object
-
withQueue
public final ImmutableLedgerRequestParams withQueue(boolean value)
Copy the current immutable object by setting a value for thequeue
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for queue- Returns:
- A modified copy of the
this
object
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutableLedgerRequestParams
that have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:ledgerSpecifier
,full
,accounts
,transactions
,expand
,ownerFunds
,binary
,queue
.
-
toString
public String toString()
Prints the immutable valueLedgerRequestParams
with attribute values.
-
copyOf
public static ImmutableLedgerRequestParams copyOf(LedgerRequestParams instance)
Creates an immutable copy of aLedgerRequestParams
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 LedgerRequestParams instance
-
builder
public static ImmutableLedgerRequestParams.Builder builder()
Creates a builder forImmutableLedgerRequestParams
.ImmutableLedgerRequestParams.builder() .ledgerHash(org.xrpl.xrpl4j.model.transactions.Hash256) // optional
ledgerHash
.ledgerIndex(org.xrpl.xrpl4j.model.client.common.LedgerIndex | null) // nullableledgerIndex
.ledgerSpecifier(org.xrpl.xrpl4j.model.client.common.LedgerSpecifier) // optionalledgerSpecifier
.full(boolean) // optionalfull
.accounts(boolean) // optionalaccounts
.transactions(boolean) // optionaltransactions
.ownerFunds(boolean) // optionalownerFunds
.queue(boolean) // optionalqueue
.build();- Returns:
- A new ImmutableLedgerRequestParams builder
-
-