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 of
LedgerSpecifier.
Use the builder to create immutable instances:
ImmutableLedgerSpecifier.builder().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableLedgerSpecifier. -
Field Summary
Fields inherited from interface org.xrpl.xrpl4j.model.client.common.LedgerSpecifier
CLOSED, CURRENT, VALIDATED -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forImmutableLedgerSpecifier.static ImmutableLedgerSpecifiercopyOf(LedgerSpecifier instance) Creates an immutable copy of aLedgerSpecifiervalue.booleanThis instance is equal to all instances ofImmutableLedgerSpecifierthat have equal attribute values.inthashCode()Computes a hash code from attributes:ledgerHash,ledgerIndex,ledgerIndexShortcut.A 20-byte hex string for the ledger version to use.The ledger index of the ledger to use.A shortcut word specifying the ledger to use.toString()Prints the immutable valueLedgerSpecifierwith attribute values.final ImmutableLedgerSpecifierwithLedgerHash(Optional<? extends Hash256> optional) Copy the current immutable object by setting an optional value for theledgerHashattribute.final ImmutableLedgerSpecifierwithLedgerHash(Hash256 value) Copy the current immutable object by setting a present value for the optionalledgerHashattribute.final ImmutableLedgerSpecifierwithLedgerIndex(Optional<? extends LedgerIndex> optional) Copy the current immutable object by setting an optional value for theledgerIndexattribute.final ImmutableLedgerSpecifierwithLedgerIndex(LedgerIndex value) Copy the current immutable object by setting a present value for the optionalledgerIndexattribute.final ImmutableLedgerSpecifierwithLedgerIndexShortcut(Optional<? extends LedgerIndexShortcut> optional) Copy the current immutable object by setting an optional value for theledgerIndexShortcutattribute.final ImmutableLedgerSpecifierCopy the current immutable object by setting a present value for the optionalledgerIndexShortcutattribute.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.xrpl.xrpl4j.model.client.common.LedgerSpecifier
handle, map, validateOnlyOneSpecified
-
Method Details
-
ledgerHash
A 20-byte hex string for the ledger version to use.- Specified by:
ledgerHashin interfaceLedgerSpecifier- Returns:
- An optionally-present
Hash256.
-
ledgerIndex
The ledger index of the ledger to use.- Specified by:
ledgerIndexin interfaceLedgerSpecifier- Returns:
- An optionally-present
LedgerIndex.
-
ledgerIndexShortcut
A shortcut word specifying the ledger to use.- Specified by:
ledgerIndexShortcutin interfaceLedgerSpecifier- Returns:
- An optionally-present
LedgerIndexShortcut.
-
withLedgerHash
Copy the current immutable object by setting a present value for the optionalledgerHashattribute.- Parameters:
value- The value for ledgerHash- Returns:
- A modified copy of
thisobject
-
withLedgerHash
Copy the current immutable object by setting an optional value for theledgerHashattribute. 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
thisobject
-
withLedgerIndex
Copy the current immutable object by setting a present value for the optionalledgerIndexattribute.- Parameters:
value- The value for ledgerIndex- Returns:
- A modified copy of
thisobject
-
withLedgerIndex
Copy the current immutable object by setting an optional value for theledgerIndexattribute. 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
thisobject
-
withLedgerIndexShortcut
Copy the current immutable object by setting a present value for the optionalledgerIndexShortcutattribute.- Parameters:
value- The value for ledgerIndexShortcut- Returns:
- A modified copy of
thisobject
-
withLedgerIndexShortcut
public final ImmutableLedgerSpecifier withLedgerIndexShortcut(Optional<? extends LedgerIndexShortcut> optional) Copy the current immutable object by setting an optional value for theledgerIndexShortcutattribute. 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
thisobject
-
equals
This instance is equal to all instances ofImmutableLedgerSpecifierthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:ledgerHash,ledgerIndex,ledgerIndexShortcut. -
toString
Prints the immutable valueLedgerSpecifierwith attribute values. -
copyOf
Creates an immutable copy of aLedgerSpecifiervalue. 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
Creates a builder forImmutableLedgerSpecifier.ImmutableLedgerSpecifier.builder() .ledgerHash(org.xrpl.xrpl4j.model.transactions.Hash256) // optionalledgerHash.ledgerIndex(org.xrpl.xrpl4j.model.client.common.LedgerIndex) // optionalledgerIndex.ledgerIndexShortcut(org.xrpl.xrpl4j.model.client.common.LedgerIndexShortcut) // optionalledgerIndexShortcut.build();- Returns:
- A new ImmutableLedgerSpecifier builder
-