Class ImmutableAcceptLedgerResult

java.lang.Object
org.xrpl.xrpl4j.model.client.admin.ImmutableAcceptLedgerResult
All Implemented Interfaces:
AcceptLedgerResult, XrplResult

@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableAcceptLedgerResult extends Object implements AcceptLedgerResult
Immutable implementation of AcceptLedgerResult.

Use the builder to create immutable instances: ImmutableAcceptLedgerResult.builder().

  • Method Details

    • status

      public Optional<String> status()
      The value "success" indicates the request was successfully received and understood by the server.
      Specified by:
      status in interface XrplResult
      Returns:
      The String "success" if the request was successful, otherwise Optional.empty().
    • ledgerCurrentIndex

      public LedgerIndex ledgerCurrentIndex()
      The Ledger Index of the current open ledger these stats describe.
      Specified by:
      ledgerCurrentIndex in interface AcceptLedgerResult
      Returns:
      A LedgerIndex denoting the current ledger index.
    • withStatus

      public final ImmutableAcceptLedgerResult withStatus(String value)
      Copy the current immutable object by setting a present value for the optional status attribute.
      Parameters:
      value - The value for status
      Returns:
      A modified copy of this object
    • withStatus

      public final ImmutableAcceptLedgerResult withStatus(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the status attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for status
      Returns:
      A modified copy of this object
    • withLedgerCurrentIndex

      public final ImmutableAcceptLedgerResult withLedgerCurrentIndex(LedgerIndex value)
      Copy the current immutable object by setting a value for the ledgerCurrentIndex attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for ledgerCurrentIndex
      Returns:
      A modified copy of the this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableAcceptLedgerResult 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: status, ledgerCurrentIndex.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static ImmutableAcceptLedgerResult copyOf(AcceptLedgerResult instance)
      Creates an immutable copy of a AcceptLedgerResult 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 AcceptLedgerResult instance
    • builder

      public static ImmutableAcceptLedgerResult.Builder builder()
      Creates a builder for ImmutableAcceptLedgerResult.
       ImmutableAcceptLedgerResult.builder()
          .status(String) // optional status
          .ledgerCurrentIndex(org.xrpl.xrpl4j.model.client.common.LedgerIndex) // required ledgerCurrentIndex
          .build();
       
      Returns:
      A new ImmutableAcceptLedgerResult builder