Package org.xrpl.xrpl4j.model.ledger
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().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableEscrowObject.Nested classes/interfaces inherited from interface org.xrpl.xrpl4j.model.ledger.LedgerObject
LedgerObject.LedgerEntryType -
Method Summary
Modifier and TypeMethodDescriptionaccount()TheAddressof the owner (sender) of this held payment.amount()The number of tokens to be delivered by the held payment.builder()Creates a builder forImmutableEscrowObject.Optional<com.google.common.primitives.UnsignedLong> The held payment can be canceled if and only if this field is present and the time it specifies has passed.Optional<com.ripple.cryptoconditions.Condition> A PREIMAGE-SHA-256 crypto-condition in DER hexadecimal encoding.static ImmutableEscrowObjectcopyOf(EscrowObject instance) Creates an immutable copy of aEscrowObjectvalue.The destinationAddresswhere the tokens are paid if the held payment is successful.A hint indicating which page of the destination's owner directory links to this object, in case the directory consists of multiple pages.Optional<com.google.common.primitives.UnsignedInteger> An arbitrary tag to further specify the destination for this held payment, such as a hosted recipient at the destination address.booleanThis instance is equal to all instances ofImmutableEscrowObjectthat have equal attribute values.Optional<com.google.common.primitives.UnsignedLong> The time, in seconds since the Ripple Epoch, after which this held payment can be finished.flags()A bit-map of boolean flags.inthashCode()Computes a hash code from attributes:ledgerEntryType,account,destination,amount,transferRate,issuerNode,condition,cancelAfter,finishAfter,flags,sourceTag,destinationTag,ownerNode,destinationNode,previousTransactionId,previousTransactionLedgerSequence,index.index()The unique ID of thisEscrowObject.A hint indicating which page of the issuer's owner directory links to this object, in case the directory consists of multiple pages.The type of ledger object, which is always "Escrow".A hint indicating which page of the owner directory links to this object, in case the directory consists of multiple pages.The identifying hash of the transaction that most recently modified this object.Optional<com.google.common.primitives.UnsignedInteger> The index of the ledger that contains the transaction that most recently modified this object.Optional<com.google.common.primitives.UnsignedInteger> An arbitrary tag to further specify the source for this held payment, such as a hosted recipient at the owner's address.toString()Prints the immutable valueEscrowObjectwith attribute values.Optional<com.google.common.primitives.UnsignedInteger> The transfer rate or transfer fee locked at escrow creation time.final ImmutableEscrowObjectwithAccount(Address value) Copy the current immutable object by setting a value for theaccountattribute.final ImmutableEscrowObjectwithAmount(CurrencyAmount value) Copy the current immutable object by setting a value for theamountattribute.final ImmutableEscrowObjectwithCancelAfter(com.google.common.primitives.UnsignedLong value) Copy the current immutable object by setting a present value for the optionalcancelAfterattribute.final ImmutableEscrowObjectwithCancelAfter(Optional<? extends com.google.common.primitives.UnsignedLong> optional) Copy the current immutable object by setting an optional value for thecancelAfterattribute.final ImmutableEscrowObjectwithCondition(com.ripple.cryptoconditions.Condition value) Copy the current immutable object by setting a present value for the optionalconditionattribute.final ImmutableEscrowObjectwithCondition(Optional<? extends com.ripple.cryptoconditions.Condition> optional) Copy the current immutable object by setting an optional value for theconditionattribute.final ImmutableEscrowObjectwithDestination(Address value) Copy the current immutable object by setting a value for thedestinationattribute.final ImmutableEscrowObjectwithDestinationNode(String value) Copy the current immutable object by setting a present value for the optionaldestinationNodeattribute.final ImmutableEscrowObjectwithDestinationNode(Optional<String> optional) Copy the current immutable object by setting an optional value for thedestinationNodeattribute.final ImmutableEscrowObjectwithDestinationTag(com.google.common.primitives.UnsignedInteger value) Copy the current immutable object by setting a present value for the optionaldestinationTagattribute.final ImmutableEscrowObjectwithDestinationTag(Optional<? extends com.google.common.primitives.UnsignedInteger> optional) Copy the current immutable object by setting an optional value for thedestinationTagattribute.final ImmutableEscrowObjectwithFinishAfter(com.google.common.primitives.UnsignedLong value) Copy the current immutable object by setting a present value for the optionalfinishAfterattribute.final ImmutableEscrowObjectwithFinishAfter(Optional<? extends com.google.common.primitives.UnsignedLong> optional) Copy the current immutable object by setting an optional value for thefinishAfterattribute.final ImmutableEscrowObjectCopy the current immutable object by setting a value for theindexattribute.final ImmutableEscrowObjectwithIssuerNode(String value) Copy the current immutable object by setting a present value for the optionalissuerNodeattribute.final ImmutableEscrowObjectwithIssuerNode(Optional<String> optional) Copy the current immutable object by setting an optional value for theissuerNodeattribute.final ImmutableEscrowObjectwithOwnerNode(String value) Copy the current immutable object by setting a present value for the optionalownerNodeattribute.final ImmutableEscrowObjectwithOwnerNode(Optional<String> optional) Copy the current immutable object by setting an optional value for theownerNodeattribute.final ImmutableEscrowObjectwithPreviousTransactionId(Optional<? extends Hash256> optional) Copy the current immutable object by setting an optional value for thepreviousTransactionIdattribute.final ImmutableEscrowObjectwithPreviousTransactionId(Hash256 value) Copy the current immutable object by setting a present value for the optionalpreviousTransactionIdattribute.final ImmutableEscrowObjectwithPreviousTransactionLedgerSequence(com.google.common.primitives.UnsignedInteger value) Copy the current immutable object by setting a present value for the optionalpreviousTransactionLedgerSequenceattribute.final ImmutableEscrowObjectwithPreviousTransactionLedgerSequence(Optional<? extends com.google.common.primitives.UnsignedInteger> optional) Copy the current immutable object by setting an optional value for thepreviousTransactionLedgerSequenceattribute.final ImmutableEscrowObjectwithSourceTag(com.google.common.primitives.UnsignedInteger value) Copy the current immutable object by setting a present value for the optionalsourceTagattribute.final ImmutableEscrowObjectwithSourceTag(Optional<? extends com.google.common.primitives.UnsignedInteger> optional) Copy the current immutable object by setting an optional value for thesourceTagattribute.final ImmutableEscrowObjectwithTransferRate(com.google.common.primitives.UnsignedInteger value) Copy the current immutable object by setting a present value for the optionaltransferRateattribute.final ImmutableEscrowObjectwithTransferRate(Optional<? extends com.google.common.primitives.UnsignedInteger> optional) Copy the current immutable object by setting an optional value for thetransferRateattribute.
-
Method Details
-
ledgerEntryType
The type of ledger object, which is always "Escrow".- Specified by:
ledgerEntryTypein interfaceEscrowObject- Returns:
- Always
LedgerObject.LedgerEntryType.ESCROW.
-
account
TheAddressof 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:
accountin interfaceEscrowObject- Returns:
- The
Addressof the owner of this escrow.
-
destination
The destinationAddresswhere the tokens are paid if the held payment is successful.- Specified by:
destinationin interfaceEscrowObject- Returns:
- The
Addressof the destination of this escrow.
-
amount
The number of tokens to be delivered by the held payment.Can be one of:
XrpCurrencyAmount- XRP in dropsIssuedCurrencyAmount- IOU tokensMptCurrencyAmount- MPT tokens
- Specified by:
amountin interfaceEscrowObject- Returns:
- A
CurrencyAmountdenoting the amount.
-
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
TransferRatesetting 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'sTransferFeesetting at the time of escrow creation.This value is used during
EscrowFinishto apply the correct fee, even if the issuer changes their transfer rate/fee after the escrow was created.- Specified by:
transferRatein interfaceEscrowObject- Returns:
- An
Optionalof typeUnsignedIntegerrepresenting the locked transfer rate or fee.
-
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:
issuerNodein interfaceEscrowObject- Returns:
- An
Optionalof typeStringcontaining the issuer node hint.
-
condition
A PREIMAGE-SHA-256 crypto-condition in DER hexadecimal encoding. If present, theEscrowFinishtransaction must contain a fulfillment that satisfies this condition.- Specified by:
conditionin interfaceEscrowObject- Returns:
- An
Optionalof typeConditioncontaining the escrow condition. - See Also:
-
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:
cancelAfterin interfaceEscrowObject- Returns:
- An
Optionalof typeUnsignedLongrepresenting the cancel after time.
-
finishAfter
The time, in seconds since the Ripple Epoch, after which this held payment can be finished. AnyEscrowFinishtransaction before this time fails. (Specifically, this is compared with the close time of the previous validated ledger.)- Specified by:
finishAfterin interfaceEscrowObject- Returns:
- An
Optionalof typeUnsignedLongrepresenting the finish after time.
-
flags
A bit-map of boolean flags. No flags are defined for theEscrowObjecttype, so this value is always 0.- Specified by:
flagsin interfaceEscrowObject- Returns:
- Always
Flags.UNSET.
-
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:
sourceTagin interfaceEscrowObject- Returns:
- An
Optionalof typeUnsignedIntegerrepresenting the tag of the owner account.
-
destinationTag
An arbitrary tag to further specify the destination for this held payment, such as a hosted recipient at the destination address.- Specified by:
destinationTagin interfaceEscrowObject- Returns:
- An
Optionalof typeUnsignedIntegerrepresenting the tag of the destination account.
-
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:
ownerNodein interfaceEscrowObject- Returns:
- An
Optionalof typeStringcontaining the owner node hint.
-
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:
destinationNodein interfaceEscrowObject- Returns:
- An
Optionalof typeStringcontaining the destination node hint.
-
previousTransactionId
The identifying hash of the transaction that most recently modified this object.- Specified by:
previousTransactionIdin interfaceEscrowObject- Returns:
- A
Hash256containing the previous transaction hash.
-
previousTransactionLedgerSequence
The index of the ledger that contains the transaction that most recently modified this object.- Specified by:
previousTransactionLedgerSequencein interfaceEscrowObject- Returns:
- An
Optionalof typeUnsignedIntegerrepresenting the previous transaction ledger sequence.
-
index
The unique ID of thisEscrowObject.- Specified by:
indexin interfaceEscrowObject- Returns:
- A
Hash256containing the ID.
-
withAccount
Copy the current immutable object by setting a value for theaccountattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for account- Returns:
- A modified copy of the
thisobject
-
withDestination
Copy the current immutable object by setting a value for thedestinationattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for destination- Returns:
- A modified copy of the
thisobject
-
withAmount
Copy the current immutable object by setting a value for theamountattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for amount- Returns:
- A modified copy of the
thisobject
-
withTransferRate
public final ImmutableEscrowObject withTransferRate(com.google.common.primitives.UnsignedInteger value) Copy the current immutable object by setting a present value for the optionaltransferRateattribute.- Parameters:
value- The value for transferRate- Returns:
- A modified copy of
thisobject
-
withTransferRate
public final ImmutableEscrowObject withTransferRate(Optional<? extends com.google.common.primitives.UnsignedInteger> optional) Copy the current immutable object by setting an optional value for thetransferRateattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for transferRate- Returns:
- A modified copy of
thisobject
-
withIssuerNode
Copy the current immutable object by setting a present value for the optionalissuerNodeattribute.- Parameters:
value- The value for issuerNode- Returns:
- A modified copy of
thisobject
-
withIssuerNode
Copy the current immutable object by setting an optional value for theissuerNodeattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for issuerNode- Returns:
- A modified copy of
thisobject
-
withCondition
Copy the current immutable object by setting a present value for the optionalconditionattribute.- Parameters:
value- The value for condition- Returns:
- A modified copy of
thisobject
-
withCondition
public final ImmutableEscrowObject withCondition(Optional<? extends com.ripple.cryptoconditions.Condition> optional) Copy the current immutable object by setting an optional value for theconditionattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for condition- Returns:
- A modified copy of
thisobject
-
withCancelAfter
Copy the current immutable object by setting a present value for the optionalcancelAfterattribute.- Parameters:
value- The value for cancelAfter- Returns:
- A modified copy of
thisobject
-
withCancelAfter
public final ImmutableEscrowObject withCancelAfter(Optional<? extends com.google.common.primitives.UnsignedLong> optional) Copy the current immutable object by setting an optional value for thecancelAfterattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for cancelAfter- Returns:
- A modified copy of
thisobject
-
withFinishAfter
Copy the current immutable object by setting a present value for the optionalfinishAfterattribute.- Parameters:
value- The value for finishAfter- Returns:
- A modified copy of
thisobject
-
withFinishAfter
public final ImmutableEscrowObject withFinishAfter(Optional<? extends com.google.common.primitives.UnsignedLong> optional) Copy the current immutable object by setting an optional value for thefinishAfterattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for finishAfter- Returns:
- A modified copy of
thisobject
-
withSourceTag
public final ImmutableEscrowObject withSourceTag(com.google.common.primitives.UnsignedInteger value) Copy the current immutable object by setting a present value for the optionalsourceTagattribute.- Parameters:
value- The value for sourceTag- Returns:
- A modified copy of
thisobject
-
withSourceTag
public final ImmutableEscrowObject withSourceTag(Optional<? extends com.google.common.primitives.UnsignedInteger> optional) Copy the current immutable object by setting an optional value for thesourceTagattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for sourceTag- Returns:
- A modified copy of
thisobject
-
withDestinationTag
public final ImmutableEscrowObject withDestinationTag(com.google.common.primitives.UnsignedInteger value) Copy the current immutable object by setting a present value for the optionaldestinationTagattribute.- Parameters:
value- The value for destinationTag- Returns:
- A modified copy of
thisobject
-
withDestinationTag
public final ImmutableEscrowObject withDestinationTag(Optional<? extends com.google.common.primitives.UnsignedInteger> optional) Copy the current immutable object by setting an optional value for thedestinationTagattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for destinationTag- Returns:
- A modified copy of
thisobject
-
withOwnerNode
Copy the current immutable object by setting a present value for the optionalownerNodeattribute.- Parameters:
value- The value for ownerNode- Returns:
- A modified copy of
thisobject
-
withOwnerNode
Copy the current immutable object by setting an optional value for theownerNodeattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for ownerNode- Returns:
- A modified copy of
thisobject
-
withDestinationNode
Copy the current immutable object by setting a present value for the optionaldestinationNodeattribute.- Parameters:
value- The value for destinationNode- Returns:
- A modified copy of
thisobject
-
withDestinationNode
Copy the current immutable object by setting an optional value for thedestinationNodeattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for destinationNode- Returns:
- A modified copy of
thisobject
-
withPreviousTransactionId
Copy the current immutable object by setting a present value for the optionalpreviousTransactionIdattribute.- Parameters:
value- The value for previousTransactionId- Returns:
- A modified copy of
thisobject
-
withPreviousTransactionId
Copy the current immutable object by setting an optional value for thepreviousTransactionIdattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for previousTransactionId- Returns:
- A modified copy of
thisobject
-
withPreviousTransactionLedgerSequence
public final ImmutableEscrowObject withPreviousTransactionLedgerSequence(com.google.common.primitives.UnsignedInteger value) Copy the current immutable object by setting a present value for the optionalpreviousTransactionLedgerSequenceattribute.- Parameters:
value- The value for previousTransactionLedgerSequence- Returns:
- A modified copy of
thisobject
-
withPreviousTransactionLedgerSequence
public final ImmutableEscrowObject withPreviousTransactionLedgerSequence(Optional<? extends com.google.common.primitives.UnsignedInteger> optional) Copy the current immutable object by setting an optional value for thepreviousTransactionLedgerSequenceattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for previousTransactionLedgerSequence- Returns:
- A modified copy of
thisobject
-
withIndex
Copy the current immutable object by setting a value for theindexattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for index- Returns:
- A modified copy of the
thisobject
-
equals
This instance is equal to all instances ofImmutableEscrowObjectthat have equal attribute values. -
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. -
toString
Prints the immutable valueEscrowObjectwith attribute values. -
copyOf
Creates an immutable copy of aEscrowObjectvalue. 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
Creates a builder forImmutableEscrowObject.ImmutableEscrowObject.builder() .account(org.xrpl.xrpl4j.model.transactions.Address) // requiredaccount.destination(org.xrpl.xrpl4j.model.transactions.Address) // requireddestination.amount(org.xrpl.xrpl4j.model.transactions.CurrencyAmount) // requiredamount.transferRate(com.google.common.primitives.UnsignedInteger) // optionaltransferRate.issuerNode(String) // optionalissuerNode.condition(com.ripple.cryptoconditions.Condition) // optionalcondition.cancelAfter(com.google.common.primitives.UnsignedLong) // optionalcancelAfter.finishAfter(com.google.common.primitives.UnsignedLong) // optionalfinishAfter.sourceTag(com.google.common.primitives.UnsignedInteger) // optionalsourceTag.destinationTag(com.google.common.primitives.UnsignedInteger) // optionaldestinationTag.ownerNode(String) // optionalownerNode.destinationNode(String) // optionaldestinationNode.previousTransactionId(org.xrpl.xrpl4j.model.transactions.Hash256) // optionalpreviousTransactionId.previousTransactionLedgerSequence(com.google.common.primitives.UnsignedInteger) // optionalpreviousTransactionLedgerSequence.index(org.xrpl.xrpl4j.model.transactions.Hash256) // requiredindex.build();- Returns:
- A new ImmutableEscrowObject builder
-