Class ImmutableTicketObject

java.lang.Object
org.xrpl.xrpl4j.model.ledger.ImmutableTicketObject
All Implemented Interfaces:
LedgerObject, TicketObject

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

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

  • Method Details

    • ledgerEntryType

      public LedgerObject.LedgerEntryType ledgerEntryType()
      The type of ledger object. In this case, always "SignerList".
      Specified by:
      ledgerEntryType in interface TicketObject
      Returns:
      Always LedgerObject.LedgerEntryType.SIGNER_LIST.
    • flags

      public Flags flags()
      A bit-map of Boolean flags enabled for this Ticket. Currently, there are no flags defined for Tickets.
      Specified by:
      flags in interface TicketObject
      Returns:
      Always returns Flags.UNSET.
    • account

      public Address account()
      The account that owns this Ticket.
      Specified by:
      account in interface TicketObject
      Returns:
      The account that owns this Ticket, as an Address.
    • ownerNode

      public String ownerNode()
      A hint indicating which page of the owner directory links to this object, in case the directory consists of multiple pages.
      Specified by:
      ownerNode in interface TicketObject
      Returns:
      A String containing the hint.
    • previousTransactionId

      public Hash256 previousTransactionId()
      The identifying hash of the transaction that most recently modified this object.
      Specified by:
      previousTransactionId in interface TicketObject
      Returns:
      A Hash256 containing the previous transaction hash.
    • previousTransactionLedgerSequence

      public com.google.common.primitives.UnsignedInteger previousTransactionLedgerSequence()
      The index of the ledger that contains the transaction that most recently modified this object.
      Specified by:
      previousTransactionLedgerSequence in interface TicketObject
      Returns:
      An UnsignedInteger representing the previous transaction ledger sequence.
    • ticketSequence

      public com.google.common.primitives.UnsignedInteger ticketSequence()
      The Sequence Number this Ticket sets aside.
      Specified by:
      ticketSequence in interface TicketObject
      Returns:
      An UnsignedInteger denoting the sequence number.
    • index

      public Hash256 index()
      The unique ID of the TicketObject.
      Specified by:
      index in interface TicketObject
      Returns:
      A Hash256.
    • withAccount

      public final ImmutableTicketObject withAccount(Address value)
      Copy the current immutable object by setting a value for the account attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for account
      Returns:
      A modified copy of the this object
    • withOwnerNode

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

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

      public final ImmutableTicketObject withPreviousTransactionLedgerSequence(com.google.common.primitives.UnsignedInteger value)
      Copy the current immutable object by setting a value for the previousTransactionLedgerSequence attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for previousTransactionLedgerSequence
      Returns:
      A modified copy of the this object
    • withTicketSequence

      public final ImmutableTicketObject withTicketSequence(com.google.common.primitives.UnsignedInteger value)
      Copy the current immutable object by setting a value for the ticketSequence attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for ticketSequence
      Returns:
      A modified copy of the this object
    • withIndex

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

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableTicketObject 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: ledgerEntryType, flags, account, ownerNode, previousTransactionId, previousTransactionLedgerSequence, ticketSequence, index.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

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

      public static ImmutableTicketObject.Builder builder()
      Creates a builder for ImmutableTicketObject.
       ImmutableTicketObject.builder()
          .account(org.xrpl.xrpl4j.model.transactions.Address) // required account
          .ownerNode(String) // required ownerNode
          .previousTransactionId(org.xrpl.xrpl4j.model.transactions.Hash256) // required previousTransactionId
          .previousTransactionLedgerSequence(com.google.common.primitives.UnsignedInteger) // required previousTransactionLedgerSequence
          .ticketSequence(com.google.common.primitives.UnsignedInteger) // required ticketSequence
          .index(org.xrpl.xrpl4j.model.transactions.Hash256) // required index
          .build();
       
      Returns:
      A new ImmutableTicketObject builder