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().

  • 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:
      transactionIndex in interface TransactionMetadata
      Returns:
      index of transaction within ledger.
    • transactionResult

      public String transactionResult()
      A result code indicating whether the transaction succeeded or how it failed.
      Specified by:
      transactionResult in interface TransactionMetadata
      Returns:
      transaction result code.
    • deliveredAmount

      public Optional<CurrencyAmount> 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:
      deliveredAmount in interface TransactionMetadata
      Returns:
      delivered amount for payments, otherwise empty for non-payments.
    • nfTokenId

      public Optional<NfTokenId> nfTokenId()
      The NfTokenId of the NfToken that was changed as a result of this transaction. Only present in metadata for NfTokenMint and NfTokenAcceptOffer transactions.
      Specified by:
      nfTokenId in interface TransactionMetadata
      Returns:
      An optionally-present NfTokenId.
    • nfTokenIds

      public com.google.common.collect.ImmutableList<NfTokenId> nfTokenIds()
      The NfTokenIds of the NfTokens changed by a NfTokenCancelOffer transaction. Only present in metadata for NfTokenCancelOffer transactions.
      Specified by:
      nfTokenIds in interface TransactionMetadata
      Returns:
      A List of NfTokenIds.
    • mpTokenIssuanceId

      public Optional<MpTokenIssuanceId> mpTokenIssuanceId()
      The MpTokenIssuanceId of the MpTokenIssuanceObject created via an MpTokenIssuanceCreate transaction.
      Specified by:
      mpTokenIssuanceId in interface TransactionMetadata
      Returns:
      An Optional MpTokenIssuanceId.
    • offerId

      public Optional<Hash256> offerId()
      The ID of the offer created by NfTokenCreateOffer transactions. Only present in metadata for NfTokenCreateOffer transactions.
      Specified by:
      offerId in interface TransactionMetadata
      Returns:
      An optionally-present Hash256 denoting the offer ID.
    • affectedNodes

      public com.google.common.collect.ImmutableList<AffectedNode> affectedNodes()
      Specified by:
      affectedNodes in interface TransactionMetadata
      Returns:
      The value of the affectedNodes attribute
    • withTransactionIndex

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

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

      public final ImmutableTransactionMetadata withDeliveredAmount(CurrencyAmount value)
      Copy the current immutable object by setting a present value for the optional deliveredAmount attribute.
      Parameters:
      value - The value for deliveredAmount
      Returns:
      A modified copy of this object
    • withDeliveredAmount

      public final ImmutableTransactionMetadata withDeliveredAmount(Optional<? extends CurrencyAmount> optional)
      Copy the current immutable object by setting an optional value for the deliveredAmount 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 deliveredAmount
      Returns:
      A modified copy of this object
    • withNfTokenId

      public final ImmutableTransactionMetadata withNfTokenId(NfTokenId value)
      Copy the current immutable object by setting a present value for the optional nfTokenId attribute.
      Parameters:
      value - The value for nfTokenId
      Returns:
      A modified copy of this object
    • withNfTokenId

      public final ImmutableTransactionMetadata withNfTokenId(Optional<? extends NfTokenId> optional)
      Copy the current immutable object by setting an optional value for the nfTokenId 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 nfTokenId
      Returns:
      A modified copy of this object
    • withNfTokenIds

      public final ImmutableTransactionMetadata withNfTokenIds(NfTokenId... elements)
      Copy the current immutable object with elements that replace the content of nfTokenIds.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withNfTokenIds

      public final ImmutableTransactionMetadata withNfTokenIds(Iterable<? extends NfTokenId> elements)
      Copy the current immutable object with elements that replace the content of nfTokenIds. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of nfTokenIds elements to set
      Returns:
      A modified copy of this object
    • withMpTokenIssuanceId

      public final ImmutableTransactionMetadata withMpTokenIssuanceId(MpTokenIssuanceId value)
      Copy the current immutable object by setting a present value for the optional mpTokenIssuanceId attribute.
      Parameters:
      value - The value for mpTokenIssuanceId
      Returns:
      A modified copy of this object
    • withMpTokenIssuanceId

      public final ImmutableTransactionMetadata withMpTokenIssuanceId(Optional<? extends MpTokenIssuanceId> optional)
      Copy the current immutable object by setting an optional value for the mpTokenIssuanceId 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 mpTokenIssuanceId
      Returns:
      A modified copy of this object
    • withOfferId

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

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

      public final ImmutableTransactionMetadata withAffectedNodes(AffectedNode... elements)
      Copy the current immutable object with elements that replace the content of affectedNodes.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withAffectedNodes

      public final ImmutableTransactionMetadata withAffectedNodes(Iterable<? extends AffectedNode> elements)
      Copy the current immutable object with elements that replace the content of affectedNodes. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of affectedNodes elements to set
      Returns:
      A modified copy of this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableTransactionMetadata 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: transactionIndex, transactionResult, deliveredAmount, nfTokenId, nfTokenIds, mpTokenIssuanceId, offerId, affectedNodes.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

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

      public static ImmutableTransactionMetadata.Builder builder()
      Creates a builder for ImmutableTransactionMetadata.
       ImmutableTransactionMetadata.builder()
          .transactionIndex(com.google.common.primitives.UnsignedInteger) // required transactionIndex
          .transactionResult(String) // required transactionResult
          .deliveredAmount(org.xrpl.xrpl4j.model.transactions.CurrencyAmount) // optional deliveredAmount
          .nfTokenId(NfTokenId) // optional nfTokenId
          .addNfTokenIds|addAllNfTokenIds(NfTokenId) // nfTokenIds elements
          .mpTokenIssuanceId(MpTokenIssuanceId) // optional mpTokenIssuanceId
          .offerId(Hash256) // optional offerId
          .addAffectedNodes|addAllAffectedNodes(org.xrpl.xrpl4j.model.transactions.metadata.AffectedNode) // affectedNodes elements
          .build();
       
      Returns:
      A new ImmutableTransactionMetadata builder