Class ImmutableCheckObject

java.lang.Object
org.xrpl.xrpl4j.model.ledger.ImmutableCheckObject
All Implemented Interfaces:
CheckObject, LedgerObject

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

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

  • Method Details

    • ledgerEntryType

      public LedgerObject.LedgerEntryType ledgerEntryType()
      The value 0x0043, mapped to the string "Check", indicates that this object is a CheckObject object.
      Specified by:
      ledgerEntryType in interface CheckObject
      Returns:
      Always LedgerObject.LedgerEntryType.CHECK.
    • account

      public Address account()
      The sender of the CheckObject. Cashing the CheckObject debits this address's balance.
      Specified by:
      account in interface CheckObject
      Returns:
      The Address of the sender.
    • sourceTag

      public Optional<com.google.common.primitives.UnsignedInteger> sourceTag()
      An arbitrary tag to further specify the source for this CheckObject, such as a hosted recipient at the sender's address.
      Specified by:
      sourceTag in interface CheckObject
      Returns:
      An Optional of type UnsignedInteger.
    • destination

      public Address destination()
      The intended recipient of the CheckObject. Only this address can cash the CheckObject, using a CheckCash transaction.
      Specified by:
      destination in interface CheckObject
      Returns:
      The Address of the destination.
    • destinationTag

      public Optional<com.google.common.primitives.UnsignedInteger> destinationTag()
      An arbitrary tag to further specify the destination for this CheckObject, such as a hosted recipient at the destination address.
      Specified by:
      destinationTag in interface CheckObject
      Returns:
      An Optional of type UnsignedInteger.
    • flags

      public Flags flags()
      A bit-map of boolean flags. No flags are defined for CheckObject, so this value is always 0.
      Specified by:
      flags in interface CheckObject
      Returns:
      Always Flags.UNSET.
    • ownerNode

      public String ownerNode()
      A hint indicating which page of the sender's owner directory links to this object, in case the directory consists of multiple pages. Note: The object does not contain a direct link to the owner directory containing it, since that value can be derived from the Account.
      Specified by:
      ownerNode in interface CheckObject
      Returns:
      A String containing the owner node hint.
    • previousTxnId

      public Hash256 previousTxnId()
      The identifying hash of the transaction that most recently modified this object.
      Specified by:
      previousTxnId in interface CheckObject
      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 CheckObject
      Returns:
      A UnsignedInteger representing the previous transaction sequence.
    • sendMax

      public CurrencyAmount sendMax()
      The maximum amount of currency this CheckObject can debit the CheckObject.account(). If the CheckObject is successfully cashed, the CheckObject.destination() is credited in the same currency for up to this amount.
      Specified by:
      sendMax in interface CheckObject
      Returns:
      A CurrencyAmount.
    • sequence

      public com.google.common.primitives.UnsignedInteger sequence()
      The sequence number of the CheckCreate transaction that created this check.
      Specified by:
      sequence in interface CheckObject
      Returns:
      An UnsignedInteger.
    • destinationNode

      public Optional<String> destinationNode()
      A hint indicating which page of the CheckObject.destination()'s owner directory links to this object, in case the directory consists of multiple pages.
      Specified by:
      destinationNode in interface CheckObject
      Returns:
      An Optional of type String.
    • expiration

      public Optional<com.google.common.primitives.UnsignedInteger> expiration()
      Indicates the time after which this Check is considered expired, in seconds since the Ripple Epoch.
      Specified by:
      expiration in interface CheckObject
      Returns:
      An Optional of type UnsignedInteger.
    • invoiceId

      public Optional<Hash256> invoiceId()
      Arbitrary 256-bit hash provided by the CheckObject.account() as a specific reason or identifier for this CheckObject.
      Specified by:
      invoiceId in interface CheckObject
      Returns:
      An Optional of type Hash256.
    • index

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

      public final ImmutableCheckObject 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
    • withSourceTag

      public final ImmutableCheckObject withSourceTag(com.google.common.primitives.UnsignedInteger value)
      Copy the current immutable object by setting a present value for the optional sourceTag attribute.
      Parameters:
      value - The value for sourceTag
      Returns:
      A modified copy of this object
    • withSourceTag

      public final ImmutableCheckObject withSourceTag(Optional<? extends com.google.common.primitives.UnsignedInteger> optional)
      Copy the current immutable object by setting an optional value for the sourceTag 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 sourceTag
      Returns:
      A modified copy of this object
    • withDestination

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

      public final ImmutableCheckObject withDestinationTag(com.google.common.primitives.UnsignedInteger value)
      Copy the current immutable object by setting a present value for the optional destinationTag attribute.
      Parameters:
      value - The value for destinationTag
      Returns:
      A modified copy of this object
    • withDestinationTag

      public final ImmutableCheckObject withDestinationTag(Optional<? extends com.google.common.primitives.UnsignedInteger> optional)
      Copy the current immutable object by setting an optional value for the destinationTag 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 destinationTag
      Returns:
      A modified copy of this object
    • withOwnerNode

      public final ImmutableCheckObject 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
    • withPreviousTxnId

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

      public final ImmutableCheckObject 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
    • withSendMax

      public final ImmutableCheckObject withSendMax(CurrencyAmount value)
      Copy the current immutable object by setting a value for the sendMax attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for sendMax
      Returns:
      A modified copy of the this object
    • withSequence

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

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

      public final ImmutableCheckObject withDestinationNode(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the destinationNode 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 destinationNode
      Returns:
      A modified copy of this object
    • withExpiration

      public final ImmutableCheckObject withExpiration(com.google.common.primitives.UnsignedInteger value)
      Copy the current immutable object by setting a present value for the optional expiration attribute.
      Parameters:
      value - The value for expiration
      Returns:
      A modified copy of this object
    • withExpiration

      public final ImmutableCheckObject withExpiration(Optional<? extends com.google.common.primitives.UnsignedInteger> optional)
      Copy the current immutable object by setting an optional value for the expiration 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 expiration
      Returns:
      A modified copy of this object
    • withInvoiceId

      public final ImmutableCheckObject withInvoiceId(Hash256 value)
      Copy the current immutable object by setting a present value for the optional invoiceId attribute.
      Parameters:
      value - The value for invoiceId
      Returns:
      A modified copy of this object
    • withInvoiceId

      public final ImmutableCheckObject withInvoiceId(Optional<? extends Hash256> optional)
      Copy the current immutable object by setting an optional value for the invoiceId 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 invoiceId
      Returns:
      A modified copy of this object
    • withIndex

      public final ImmutableCheckObject 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 ImmutableCheckObject 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, account, sourceTag, destination, destinationTag, flags, ownerNode, previousTxnId, previousTransactionLedgerSequence, sendMax, sequence, destinationNode, expiration, invoiceId, index.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

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

      public static ImmutableCheckObject.Builder builder()
      Creates a builder for ImmutableCheckObject.
       ImmutableCheckObject.builder()
          .account(org.xrpl.xrpl4j.model.transactions.Address) // required account
          .sourceTag(com.google.common.primitives.UnsignedInteger) // optional sourceTag
          .destination(org.xrpl.xrpl4j.model.transactions.Address) // required destination
          .destinationTag(com.google.common.primitives.UnsignedInteger) // optional destinationTag
          .ownerNode(String) // required ownerNode
          .previousTxnId(org.xrpl.xrpl4j.model.transactions.Hash256) // required previousTxnId
          .previousTransactionLedgerSequence(com.google.common.primitives.UnsignedInteger) // required previousTransactionLedgerSequence
          .sendMax(org.xrpl.xrpl4j.model.transactions.CurrencyAmount) // required sendMax
          .sequence(com.google.common.primitives.UnsignedInteger) // required sequence
          .destinationNode(String) // optional destinationNode
          .expiration(com.google.common.primitives.UnsignedInteger) // optional expiration
          .invoiceId(org.xrpl.xrpl4j.model.transactions.Hash256) // optional invoiceId
          .index(org.xrpl.xrpl4j.model.transactions.Hash256) // required index
          .build();
       
      Returns:
      A new ImmutableCheckObject builder