Class ImmutableLedgerSpecifier
- java.lang.Object
-
- org.xrpl.xrpl4j.model.client.common.ImmutableLedgerSpecifier
-
- All Implemented Interfaces:
LedgerSpecifier
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableLedgerSpecifier extends Object implements LedgerSpecifier
Immutable implementation ofLedgerSpecifier
.Use the builder to create immutable instances:
ImmutableLedgerSpecifier.builder()
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ImmutableLedgerSpecifier.Builder
Builds instances of typeImmutableLedgerSpecifier
.
-
Field Summary
-
Fields inherited from interface org.xrpl.xrpl4j.model.client.common.LedgerSpecifier
CLOSED, CURRENT, VALIDATED
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableLedgerSpecifier.Builder
builder()
Creates a builder forImmutableLedgerSpecifier
.static ImmutableLedgerSpecifier
copyOf(LedgerSpecifier instance)
Creates an immutable copy of aLedgerSpecifier
value.boolean
equals(Object another)
This instance is equal to all instances ofImmutableLedgerSpecifier
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:ledgerHash
,ledgerIndex
,ledgerIndexShortcut
.Optional<Hash256>
ledgerHash()
A 20-byte hex string for the ledger version to use.Optional<LedgerIndex>
ledgerIndex()
The ledger index of the ledger to use.Optional<LedgerIndexShortcut>
ledgerIndexShortcut()
A shortcut word specifying the ledger to use.String
toString()
Prints the immutable valueLedgerSpecifier
with attribute values.ImmutableLedgerSpecifier
withLedgerHash(Optional<? extends Hash256> optional)
Copy the current immutable object by setting an optional value for theledgerHash
attribute.ImmutableLedgerSpecifier
withLedgerHash(Hash256 value)
Copy the current immutable object by setting a present value for the optionalledgerHash
attribute.ImmutableLedgerSpecifier
withLedgerIndex(Optional<? extends LedgerIndex> optional)
Copy the current immutable object by setting an optional value for theledgerIndex
attribute.ImmutableLedgerSpecifier
withLedgerIndex(LedgerIndex value)
Copy the current immutable object by setting a present value for the optionalledgerIndex
attribute.ImmutableLedgerSpecifier
withLedgerIndexShortcut(Optional<? extends LedgerIndexShortcut> optional)
Copy the current immutable object by setting an optional value for theledgerIndexShortcut
attribute.ImmutableLedgerSpecifier
withLedgerIndexShortcut(LedgerIndexShortcut value)
Copy the current immutable object by setting a present value for the optionalledgerIndexShortcut
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.common.LedgerSpecifier
handle, map, validateOnlyOneSpecified
-
-
-
-
Method Detail
-
ledgerHash
public Optional<Hash256> ledgerHash()
A 20-byte hex string for the ledger version to use.- Specified by:
ledgerHash
in interfaceLedgerSpecifier
- Returns:
- An optionally-present
Hash256
.
-
ledgerIndex
public Optional<LedgerIndex> ledgerIndex()
The ledger index of the ledger to use.- Specified by:
ledgerIndex
in interfaceLedgerSpecifier
- Returns:
- An optionally-present
LedgerIndex
.
-
ledgerIndexShortcut
public Optional<LedgerIndexShortcut> ledgerIndexShortcut()
A shortcut word specifying the ledger to use.- Specified by:
ledgerIndexShortcut
in interfaceLedgerSpecifier
- Returns:
- An optionally-present
LedgerIndexShortcut
.
-
withLedgerHash
public final ImmutableLedgerSpecifier 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 ImmutableLedgerSpecifier 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
public final ImmutableLedgerSpecifier withLedgerIndex(LedgerIndex value)
Copy the current immutable object by setting a present value for the optionalledgerIndex
attribute.- Parameters:
value
- The value for ledgerIndex- Returns:
- A modified copy of
this
object
-
withLedgerIndex
public final ImmutableLedgerSpecifier withLedgerIndex(Optional<? extends LedgerIndex> optional)
Copy the current immutable object by setting an optional value for theledgerIndex
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 ledgerIndex- Returns:
- A modified copy of
this
object
-
withLedgerIndexShortcut
public final ImmutableLedgerSpecifier withLedgerIndexShortcut(LedgerIndexShortcut value)
Copy the current immutable object by setting a present value for the optionalledgerIndexShortcut
attribute.- Parameters:
value
- The value for ledgerIndexShortcut- Returns:
- A modified copy of
this
object
-
withLedgerIndexShortcut
public final ImmutableLedgerSpecifier withLedgerIndexShortcut(Optional<? extends LedgerIndexShortcut> optional)
Copy the current immutable object by setting an optional value for theledgerIndexShortcut
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 ledgerIndexShortcut- Returns:
- A modified copy of
this
object
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutableLedgerSpecifier
that have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:ledgerHash
,ledgerIndex
,ledgerIndexShortcut
.
-
toString
public String toString()
Prints the immutable valueLedgerSpecifier
with attribute values.
-
copyOf
public static ImmutableLedgerSpecifier copyOf(LedgerSpecifier instance)
Creates an immutable copy of aLedgerSpecifier
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 LedgerSpecifier instance
-
builder
public static ImmutableLedgerSpecifier.Builder builder()
Creates a builder forImmutableLedgerSpecifier
.ImmutableLedgerSpecifier.builder() .ledgerHash(org.xrpl.xrpl4j.model.transactions.Hash256) // optional
ledgerHash
.ledgerIndex(org.xrpl.xrpl4j.model.client.common.LedgerIndex) // optionalledgerIndex
.ledgerIndexShortcut(org.xrpl.xrpl4j.model.client.common.LedgerIndexShortcut) // optionalledgerIndexShortcut
.build();- Returns:
- A new ImmutableLedgerSpecifier builder
-
-