Class ImmutableTransactionMetadata
java.lang.Object
org.xrpl.xrpl4j.model.transactions.ImmutableTransactionMetadata
- All Implemented Interfaces:
TransactionMetadata
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@Immutable
@CheckReturnValue
public final class ImmutableTransactionMetadata
extends Object
implements TransactionMetadata
Immutable implementation of
TransactionMetadata.
Use the builder to create immutable instances:
ImmutableTransactionMetadata.builder().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableTransactionMetadata. -
Method Summary
Modifier and TypeMethodDescriptioncom.google.common.collect.ImmutableList<AffectedNode> builder()Creates a builder forImmutableTransactionMetadata.static ImmutableTransactionMetadatacopyOf(TransactionMetadata instance) Creates an immutable copy of aTransactionMetadatavalue.The Currency Amount actually received by the Destination account.booleanThis instance is equal to all instances ofImmutableTransactionMetadatathat have equal attribute values.inthashCode()Computes a hash code from attributes:transactionIndex,transactionResult,deliveredAmount,nfTokenId,nfTokenIds,mpTokenIssuanceId,offerId,affectedNodes.TheMpTokenIssuanceIdof theMpTokenIssuanceObjectcreated via anMpTokenIssuanceCreatetransaction.com.google.common.collect.ImmutableList<NfTokenId> offerId()The ID of the offer created byNfTokenCreateOffertransactions.toString()Prints the immutable valueTransactionMetadatawith attribute values.com.google.common.primitives.UnsignedIntegerThe transaction's position within the ledger that included it.A result code indicating whether the transaction succeeded or how it failed.withAffectedNodes(Iterable<? extends AffectedNode> elements) Copy the current immutable object with elements that replace the content ofaffectedNodes.withAffectedNodes(AffectedNode... elements) Copy the current immutable object with elements that replace the content ofaffectedNodes.withDeliveredAmount(Optional<? extends CurrencyAmount> optional) Copy the current immutable object by setting an optional value for thedeliveredAmountattribute.Copy the current immutable object by setting a present value for the optionaldeliveredAmountattribute.withMpTokenIssuanceId(Optional<? extends MpTokenIssuanceId> optional) Copy the current immutable object by setting an optional value for thempTokenIssuanceIdattribute.Copy the current immutable object by setting a present value for the optionalmpTokenIssuanceIdattribute.withNfTokenId(Optional<? extends NfTokenId> optional) Copy the current immutable object by setting an optional value for thenfTokenIdattribute.withNfTokenId(NfTokenId value) Copy the current immutable object by setting a present value for the optionalnfTokenIdattribute.withNfTokenIds(Iterable<? extends NfTokenId> elements) Copy the current immutable object with elements that replace the content ofnfTokenIds.withNfTokenIds(NfTokenId... elements) Copy the current immutable object with elements that replace the content ofnfTokenIds.withOfferId(Optional<? extends Hash256> optional) Copy the current immutable object by setting an optional value for theofferIdattribute.withOfferId(Hash256 value) Copy the current immutable object by setting a present value for the optionalofferIdattribute.withTransactionIndex(com.google.common.primitives.UnsignedInteger value) Copy the current immutable object by setting a value for thetransactionIndexattribute.withTransactionResult(String value) Copy the current immutable object by setting a value for thetransactionResultattribute.
-
Method Details
-
transactionIndex
public com.google.common.primitives.UnsignedInteger transactionIndex()The transaction's position within the ledger that included it. This is zero-indexed. For example, the value 2 means it was the 3rd transaction in that ledger.- Specified by:
transactionIndexin interfaceTransactionMetadata- Returns:
- index of transaction within ledger.
-
transactionResult
A result code indicating whether the transaction succeeded or how it failed.- Specified by:
transactionResultin interfaceTransactionMetadata- Returns:
- transaction result code.
-
deliveredAmount
The Currency Amount actually received by the Destination account. Use this field to determine how much was delivered, regardless of whether the transaction is a partial payment. Omitted for non-Payment transactions.- Specified by:
deliveredAmountin interfaceTransactionMetadata- Returns:
- delivered amount for payments, otherwise empty for non-payments.
-
nfTokenId
TheNfTokenIdof theNfTokenthat was changed as a result of this transaction. Only present in metadata forNfTokenMintandNfTokenAcceptOffertransactions.- Specified by:
nfTokenIdin interfaceTransactionMetadata- Returns:
- An optionally-present
NfTokenId.
-
nfTokenIds
TheNfTokenIds of theNfTokens changed by aNfTokenCancelOffertransaction. Only present in metadata forNfTokenCancelOffertransactions.- Specified by:
nfTokenIdsin interfaceTransactionMetadata- Returns:
- A
ListofNfTokenIds.
-
mpTokenIssuanceId
TheMpTokenIssuanceIdof theMpTokenIssuanceObjectcreated via anMpTokenIssuanceCreatetransaction.- Specified by:
mpTokenIssuanceIdin interfaceTransactionMetadata- Returns:
- An
OptionalMpTokenIssuanceId.
-
offerId
The ID of the offer created byNfTokenCreateOffertransactions. Only present in metadata forNfTokenCreateOffertransactions.- Specified by:
offerIdin interfaceTransactionMetadata- Returns:
- An optionally-present
Hash256denoting the offer ID.
-
affectedNodes
- Specified by:
affectedNodesin interfaceTransactionMetadata- Returns:
- The value of the
affectedNodesattribute
-
withTransactionIndex
public final ImmutableTransactionMetadata withTransactionIndex(com.google.common.primitives.UnsignedInteger value) Copy the current immutable object by setting a value for thetransactionIndexattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for transactionIndex- Returns:
- A modified copy of the
thisobject
-
withTransactionResult
Copy the current immutable object by setting a value for thetransactionResultattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for transactionResult- Returns:
- A modified copy of the
thisobject
-
withDeliveredAmount
Copy the current immutable object by setting a present value for the optionaldeliveredAmountattribute.- Parameters:
value- The value for deliveredAmount- Returns:
- A modified copy of
thisobject
-
withDeliveredAmount
public final ImmutableTransactionMetadata withDeliveredAmount(Optional<? extends CurrencyAmount> optional) Copy the current immutable object by setting an optional value for thedeliveredAmountattribute. 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 deliveredAmount- Returns:
- A modified copy of
thisobject
-
withNfTokenId
Copy the current immutable object by setting a present value for the optionalnfTokenIdattribute.- Parameters:
value- The value for nfTokenId- Returns:
- A modified copy of
thisobject
-
withNfTokenId
Copy the current immutable object by setting an optional value for thenfTokenIdattribute. 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 nfTokenId- Returns:
- A modified copy of
thisobject
-
withNfTokenIds
Copy the current immutable object with elements that replace the content ofnfTokenIds.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withNfTokenIds
Copy the current immutable object with elements that replace the content ofnfTokenIds. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of nfTokenIds elements to set- Returns:
- A modified copy of
thisobject
-
withMpTokenIssuanceId
Copy the current immutable object by setting a present value for the optionalmpTokenIssuanceIdattribute.- Parameters:
value- The value for mpTokenIssuanceId- Returns:
- A modified copy of
thisobject
-
withMpTokenIssuanceId
public final ImmutableTransactionMetadata withMpTokenIssuanceId(Optional<? extends MpTokenIssuanceId> optional) Copy the current immutable object by setting an optional value for thempTokenIssuanceIdattribute. 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 mpTokenIssuanceId- Returns:
- A modified copy of
thisobject
-
withOfferId
Copy the current immutable object by setting a present value for the optionalofferIdattribute.- Parameters:
value- The value for offerId- Returns:
- A modified copy of
thisobject
-
withOfferId
Copy the current immutable object by setting an optional value for theofferIdattribute. 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 offerId- Returns:
- A modified copy of
thisobject
-
withAffectedNodes
Copy the current immutable object with elements that replace the content ofaffectedNodes.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withAffectedNodes
public final ImmutableTransactionMetadata withAffectedNodes(Iterable<? extends AffectedNode> elements) Copy the current immutable object with elements that replace the content ofaffectedNodes. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of affectedNodes elements to set- Returns:
- A modified copy of
thisobject
-
equals
This instance is equal to all instances ofImmutableTransactionMetadatathat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:transactionIndex,transactionResult,deliveredAmount,nfTokenId,nfTokenIds,mpTokenIssuanceId,offerId,affectedNodes. -
toString
Prints the immutable valueTransactionMetadatawith attribute values. -
copyOf
Creates an immutable copy of aTransactionMetadatavalue. 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 TransactionMetadata instance
-
builder
Creates a builder forImmutableTransactionMetadata.ImmutableTransactionMetadata.builder() .transactionIndex(com.google.common.primitives.UnsignedInteger) // requiredtransactionIndex.transactionResult(String) // requiredtransactionResult.deliveredAmount(org.xrpl.xrpl4j.model.transactions.CurrencyAmount) // optionaldeliveredAmount.nfTokenId(NfTokenId) // optionalnfTokenId.addNfTokenIds|addAllNfTokenIds(NfTokenId) //nfTokenIdselements .mpTokenIssuanceId(MpTokenIssuanceId) // optionalmpTokenIssuanceId.offerId(Hash256) // optionalofferId.addAffectedNodes|addAllAffectedNodes(org.xrpl.xrpl4j.model.transactions.metadata.AffectedNode) //affectedNodeselements .build();- Returns:
- A new ImmutableTransactionMetadata builder
-