net.corda.core.transactions

## Interface TraversableTransaction

- All Known Implementing Classes:
    FilteredLeaves, WireTransaction

      public TraversableTransaction

  Implemented by `class WireTransaction` and `class FilteredLeaves`. 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.

  The availableComponents property is used for calculation of the transaction's `class MerkleTree`, which is in turn used to derive the ID hash.

  See Also:
    `class WireTransaction`, `class FilteredLeaves`, `class MerkleTree`

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static class` | `TraversableTransaction.DefaultImpls` Implemented by `class WireTransaction` and `class FilteredLeaves`. 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.

  - ### Method Summary

    All Methods Instance Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.util.List<net.corda.core.crypto.SecureHash>` | `getAttachments()`
    `java.util.List<net.corda.core.crypto.SecureHash>` | `getAvailableComponentHashes()` Calculate the hashes of the sub-components of the transaction, that are used to build its Merkle tree. The root of the tree is the transaction identifier. The tree structure is helpful for privacy, please see the user-guide section "Transaction tear-offs" to learn more about this topic.
    `java.util.List<java.lang.Object>` | `getAvailableComponents()` Returns a flattened list of all the components that are present in the transaction, in the following order:
    `java.util.List<net.corda.core.contracts.Command>` | `getCommands()`
    `java.util.List<net.corda.core.contracts.StateRef>` | `getInputs()`
    `java.util.List<net.corda.core.crypto.CompositeKey>` | `getMustSign()`
    `Party` | `getNotary()`
    `java.util.List<net.corda.core.contracts.TransactionState>` | `getOutputs()`
    `Timestamp` | `getTimestamp()`
    `TransactionType` | `getType()`

- - ### Method Detail

    - #### getInputs

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

    - #### getAttachments

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

    - #### getOutputs

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

    - #### getCommands

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

    - #### getNotary

          Party getNotary()

    - #### getMustSign

          java.util.List<net.corda.core.crypto.CompositeKey> getMustSign()

    - #### getType

          TransactionType getType()

    - #### getTimestamp

          Timestamp getTimestamp()

    - #### getAvailableComponents

          java.util.List<java.lang.Object> getAvailableComponents()

      Returns a flattened list of all the components that are present in the transaction, in the following order:

      - Each input that is present

      - Each attachment that is present

      - Each output that is present

      - Each command that is present

      - The notary `class Party`, if present

      - Each required signer (mustSign) that is present

      - The type of the transaction, if present

      - The timestamp of the transaction, if present

      See Also:
        `class Party`

    - #### getAvailableComponentHashes

          java.util.List<net.corda.core.crypto.SecureHash> getAvailableComponentHashes()

      Calculate the hashes of the sub-components of the transaction, that are used to build its Merkle tree. The root of the tree is the transaction identifier. The tree structure is helpful for privacy, please see the user-guide section "Transaction tear-offs" to learn more about this topic.