Class ImmutableEscrowObject

java.lang.Object
org.xrpl.xrpl4j.model.ledger.ImmutableEscrowObject
All Implemented Interfaces:
EscrowObject, LedgerObject

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

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

  • Method Details

    • ledgerEntryType

      public LedgerObject.LedgerEntryType ledgerEntryType()
      The type of ledger object, which is always "Escrow".
      Specified by:
      ledgerEntryType in interface EscrowObject
      Returns:
      Always LedgerObject.LedgerEntryType.ESCROW.
    • account

      public Address account()
      The Address of the owner (sender) of this held payment. This is the account that provided the tokens, and gets them back if the held payment is canceled.
      Specified by:
      account in interface EscrowObject
      Returns:
      The Address of the owner of this escrow.
    • destination

      public Address destination()
      The destination Address where the tokens are paid if the held payment is successful.
      Specified by:
      destination in interface EscrowObject
      Returns:
      The Address of the destination of this escrow.
    • amount

      public CurrencyAmount amount()
      The number of tokens to be delivered by the held payment.

      Can be one of:

      Specified by:
      amount in interface EscrowObject
      Returns:
      A CurrencyAmount denoting the amount.
    • transferRate

      public Optional<com.google.common.primitives.UnsignedInteger> transferRate()
      The transfer rate or transfer fee locked at escrow creation time. This field is present only for IOU or MPT escrows (not XRP escrows).

      For IOU tokens, this represents the transfer rate (in billionths of a unit) from the issuer's TransferRate setting at the time of escrow creation. For MPT tokens, this represents the transfer fee (in ten-thousandths of a basis point) from the MPT issuance's TransferFee setting at the time of escrow creation.

      This value is used during EscrowFinish to apply the correct fee, even if the issuer changes their transfer rate/fee after the escrow was created.

      Specified by:
      transferRate in interface EscrowObject
      Returns:
      An Optional of type UnsignedInteger representing the locked transfer rate or fee.
    • issuerNode

      public Optional<String> issuerNode()
      A hint indicating which page of the issuer's owner directory links to this object, in case the directory consists of multiple pages. This field is present only when the issuer is neither the source nor the destination of the escrow (i.e., for IOU or MPT escrows where a third-party issuer is involved).
      Specified by:
      issuerNode in interface EscrowObject
      Returns:
      An Optional of type String containing the issuer node hint.
    • condition

      public Optional<com.ripple.cryptoconditions.Condition> condition()
      A PREIMAGE-SHA-256 crypto-condition in DER hexadecimal encoding. If present, the EscrowFinish transaction must contain a fulfillment that satisfies this condition.
      Specified by:
      condition in interface EscrowObject
      Returns:
      An Optional of type Condition containing the escrow condition.
      See Also:
      • "https://tools.ietf.org/html/draft-thomas-crypto-conditions-04#section-8.1"
    • cancelAfter

      public Optional<com.google.common.primitives.UnsignedLong> cancelAfter()
      The held payment can be canceled if and only if this field is present and the time it specifies has passed. Specifically, this is specified as seconds since the Ripple Epoch and it "has passed" if it's earlier than the close time of the previous validated ledger.
      Specified by:
      cancelAfter in interface EscrowObject
      Returns:
      An Optional of type UnsignedLong representing the cancel after time.
    • finishAfter

      public Optional<com.google.common.primitives.UnsignedLong> finishAfter()
      The time, in seconds since the Ripple Epoch, after which this held payment can be finished. Any EscrowFinish transaction before this time fails. (Specifically, this is compared with the close time of the previous validated ledger.)
      Specified by:
      finishAfter in interface EscrowObject
      Returns:
      An Optional of type UnsignedLong representing the finish after time.
    • flags

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

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

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

      public Optional<String> ownerNode()
      A hint indicating which page of the 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 EscrowObject
      Returns:
      An Optional of type String containing the owner node hint.
    • destinationNode

      public Optional<String> destinationNode()
      A hint indicating which page of the destination's owner directory links to this object, in case the directory consists of multiple pages. Omitted on escrows created before enabling the fix1523 amendment.
      Specified by:
      destinationNode in interface EscrowObject
      Returns:
      An Optional of type String containing the destination node hint.
    • previousTransactionId

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

      public Optional<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 EscrowObject
      Returns:
      An Optional of type UnsignedInteger representing the previous transaction ledger sequence.
    • index

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

      public final ImmutableEscrowObject 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
    • withDestination

      public final ImmutableEscrowObject 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
    • withAmount

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

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

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

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

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

      public final ImmutableEscrowObject withCondition(com.ripple.cryptoconditions.Condition value)
      Copy the current immutable object by setting a present value for the optional condition attribute.
      Parameters:
      value - The value for condition
      Returns:
      A modified copy of this object
    • withCondition

      public final ImmutableEscrowObject withCondition(Optional<? extends com.ripple.cryptoconditions.Condition> optional)
      Copy the current immutable object by setting an optional value for the condition 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 condition
      Returns:
      A modified copy of this object
    • withCancelAfter

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

      public final ImmutableEscrowObject withCancelAfter(Optional<? extends com.google.common.primitives.UnsignedLong> optional)
      Copy the current immutable object by setting an optional value for the cancelAfter 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 cancelAfter
      Returns:
      A modified copy of this object
    • withFinishAfter

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

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

      public final ImmutableEscrowObject 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 ImmutableEscrowObject 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
    • withDestinationTag

      public final ImmutableEscrowObject 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 ImmutableEscrowObject 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 ImmutableEscrowObject withOwnerNode(String value)
      Copy the current immutable object by setting a present value for the optional ownerNode attribute.
      Parameters:
      value - The value for ownerNode
      Returns:
      A modified copy of this object
    • withOwnerNode

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

      public final ImmutableEscrowObject 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 ImmutableEscrowObject 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
    • withPreviousTransactionId

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

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

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

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

      public final ImmutableEscrowObject 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 ImmutableEscrowObject 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, destination, amount, transferRate, issuerNode, condition, cancelAfter, finishAfter, flags, sourceTag, destinationTag, ownerNode, destinationNode, previousTransactionId, previousTransactionLedgerSequence, index.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

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

      public static ImmutableEscrowObject.Builder builder()
      Creates a builder for ImmutableEscrowObject.
       ImmutableEscrowObject.builder()
          .account(org.xrpl.xrpl4j.model.transactions.Address) // required account
          .destination(org.xrpl.xrpl4j.model.transactions.Address) // required destination
          .amount(org.xrpl.xrpl4j.model.transactions.CurrencyAmount) // required amount
          .transferRate(com.google.common.primitives.UnsignedInteger) // optional transferRate
          .issuerNode(String) // optional issuerNode
          .condition(com.ripple.cryptoconditions.Condition) // optional condition
          .cancelAfter(com.google.common.primitives.UnsignedLong) // optional cancelAfter
          .finishAfter(com.google.common.primitives.UnsignedLong) // optional finishAfter
          .sourceTag(com.google.common.primitives.UnsignedInteger) // optional sourceTag
          .destinationTag(com.google.common.primitives.UnsignedInteger) // optional destinationTag
          .ownerNode(String) // optional ownerNode
          .destinationNode(String) // optional destinationNode
          .previousTransactionId(org.xrpl.xrpl4j.model.transactions.Hash256) // optional previousTransactionId
          .previousTransactionLedgerSequence(com.google.common.primitives.UnsignedInteger) // optional previousTransactionLedgerSequence
          .index(org.xrpl.xrpl4j.model.transactions.Hash256) // required index
          .build();
       
      Returns:
      A new ImmutableEscrowObject builder