TraversableTransaction
Keywords: net.corda.core.transactions.TraversableTransaction class
Date: 2023-09-18

net.corda.core.transactions

## Class TraversableTransaction

- net.corda.core.transactions.BaseTransaction
- - net.corda.core.transactions.CoreTransaction
  - - net.corda.core.transactions.TraversableTransaction

- All Implemented Interfaces:
    NamedByHash
  Direct Known Subclasses:
    FilteredTransaction, WireTransaction

      public class TraversableTransaction
      extends CoreTransaction

  Implemented by `class WireTransaction` and `class FilteredTransaction`. A TraversableTransaction allows you to iterate over the flattened components of the underlying transaction structure, taking into account that some may be missing in the case of this representing a "torn" transaction. Please see the user guide section "Transaction tear-offs" to learn more about this feature.

  See Also:
    `class WireTransaction`, `class FilteredTransaction`

- - ### Constructor Detail

    - #### TraversableTransaction

          public TraversableTransaction(@NotNull
                                        java.util.List<? extends net.corda.core.transactions.ComponentGroup> componentGroups,
                                        @NotNull
                                        DigestService digestService)

      Implemented by `class WireTransaction` and `class FilteredTransaction`. A TraversableTransaction allows you to iterate over the flattened components of the underlying transaction structure, taking into account that some may be missing in the case of this representing a "torn" transaction. Please see the user guide section "Transaction tear-offs" to learn more about this feature.

      See Also:
        `class WireTransaction`, `class FilteredTransaction`

    - #### TraversableTransaction

          public TraversableTransaction(@NotNull
                                        java.util.List<? extends net.corda.core.transactions.ComponentGroup> componentGroups)

      Old version of `class TraversableTransaction` constructor for ABI compatibility.

      See Also:
        `class TraversableTransaction`

  - ### Method Detail

    - #### getAttachments

          @NotNull
          public java.util.List<net.corda.core.crypto.SecureHash> getAttachments()

      Hashes of the ZIP/JAR files that are needed to interpret the contents of this wire transaction.

    - #### getInputs

          @NotNull
          public java.util.List<net.corda.core.contracts.StateRef> getInputs()

      Pointers to the input states on the ledger, identified by (tx identity hash, output index).

    - #### getReferences

          @NotNull
          public java.util.List<net.corda.core.contracts.StateRef> getReferences()

      Pointers to reference states, identified by (tx identity hash, output index).

    - #### getOutputs

          @NotNull
          public java.util.List<net.corda.core.contracts.TransactionState> getOutputs()

      Ordered list of states defined by this transaction, along with the associated notaries.

    - #### getCommands

          @NotNull
          public java.util.List<net.corda.core.contracts.Command> getCommands()

      Ordered list of (`interface CommandData`, PublicKey) pairs that instruct the contracts what to do.

      See Also:
        `interface CommandData`, PublicKey

    - #### getNotary

          @Nullable
          public Party getNotary()

      If present, the notary for this transaction. If absent then the transaction is not notarised at all. This is intended for issuance/genesis transactions that don't consume any other states and thus can't double spend anything.

    - #### getTimeWindow

          @Nullable
          public TimeWindow getTimeWindow()

    - #### getNetworkParametersHash

          @Nullable
          public SecureHash getNetworkParametersHash()

      Hash of the network parameters that were in force when the transaction was notarised. Null means, that the transaction was created on older version of Corda (before 4), resolution will default to initial parameters.

    - #### getAvailableComponentGroups

          @NotNull
          public java.util.List<java.util.List> getAvailableComponentGroups()

      Returns a list of all the component groups that are present in the transaction, excluding the privacySalt, in the following order (which is the same with the order in `enum ComponentGroupEnum`:

      - list of each input that is present

      - list of each output that is present

      - list of each command that is present

      - list of each attachment that is present

      - The notary `class Party`, if present (list with one element)

      - The time-window of the transaction, if present (list with one element)

      - list of each reference input that is present

      - network parameters hash if present

      See Also:
        `enum ComponentGroupEnum`, `class Party`

    - #### getComponentGroups

          @NotNull
          public java.util.List<net.corda.core.transactions.ComponentGroup> getComponentGroups()

    - #### getDigestService

          @NotNull
          public DigestService getDigestService()