Class ImmutableBook

java.lang.Object
org.xrpl.xrpl4j.model.ledger.ImmutableBook
All Implemented Interfaces:
Book

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

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

  • Method Details

    • bookDirectory

      public Hash256 bookDirectory()
      The ID of the Offer Directory that links to this offer.
      Specified by:
      bookDirectory in interface Book
      Returns:
      A Hash256 containing the ID.
    • bookNode

      public String bookNode()
      A hint indicating which page of the offer directory links to this object, in case the directory consists of multiple pages.
      Specified by:
      bookNode in interface Book
      Returns:
      A String containing the hint.
    • withBookDirectory

      public final ImmutableBook withBookDirectory(Hash256 value)
      Copy the current immutable object by setting a value for the bookDirectory attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for bookDirectory
      Returns:
      A modified copy of the this object
    • withBookNode

      public final ImmutableBook withBookNode(String value)
      Copy the current immutable object by setting a value for the bookNode attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for bookNode
      Returns:
      A modified copy of the this object
    • equals

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

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

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

      public static ImmutableBook.Builder builder()
      Creates a builder for ImmutableBook.
       ImmutableBook.builder()
          .bookDirectory(org.xrpl.xrpl4j.model.transactions.Hash256) // required bookDirectory
          .bookNode(String) // required bookNode
          .build();
       
      Returns:
      A new ImmutableBook builder