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().

  • Method Details

    • ledgerHash

      public Optional<Hash256> ledgerHash()
      A 20-byte hex string for the ledger version to use.
      Specified by:
      ledgerHash in interface LedgerSpecifier
      Returns:
      An optionally-present Hash256.
    • ledgerIndex

      public Optional<LedgerIndex> ledgerIndex()
      The ledger index of the ledger to use.
      Specified by:
      ledgerIndex in interface LedgerSpecifier
      Returns:
      An optionally-present LedgerIndex.
    • ledgerIndexShortcut

      public Optional<LedgerIndexShortcut> ledgerIndexShortcut()
      A shortcut word specifying the ledger to use.
      Specified by:
      ledgerIndexShortcut in interface LedgerSpecifier
      Returns:
      An optionally-present LedgerIndexShortcut.
    • withLedgerHash

      public final ImmutableLedgerSpecifier withLedgerHash(Hash256 value)
      Copy the current immutable object by setting a present value for the optional ledgerHash 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 the ledgerHash attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      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 optional ledgerIndex 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 the ledgerIndex attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      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 optional ledgerIndexShortcut 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 the ledgerIndexShortcut attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      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 of ImmutableLedgerSpecifier that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: ledgerHash, ledgerIndex, ledgerIndexShortcut.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value LedgerSpecifier with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • copyOf

      public static ImmutableLedgerSpecifier copyOf(LedgerSpecifier instance)
      Creates an immutable copy of a LedgerSpecifier 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 for ImmutableLedgerSpecifier.
       ImmutableLedgerSpecifier.builder()
          .ledgerHash(org.xrpl.xrpl4j.model.transactions.Hash256) // optional ledgerHash
          .ledgerIndex(org.xrpl.xrpl4j.model.client.common.LedgerIndex) // optional ledgerIndex
          .ledgerIndexShortcut(org.xrpl.xrpl4j.model.client.common.LedgerIndexShortcut) // optional ledgerIndexShortcut
          .build();
       
      Returns:
      A new ImmutableLedgerSpecifier builder