net.corda.core.transactions

## Class FilteredLeaves

- net.corda.core.transactions.FilteredLeaves

- All Implemented Interfaces:
    TraversableTransaction

      public class FilteredLeaves
      implements TraversableTransaction

  Class that holds filtered leaves for a partial Merkle transaction. We assume mixed leaf types, notice that every field from `class WireTransaction` can be used in `class PartialMerkleTree` calculation.

  See Also:
    `class WireTransaction`, `class PartialMerkleTree`

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface net.corda.core.transactions.TraversableTransaction

      `TraversableTransaction.DefaultImpls`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `FilteredLeaves(java.util.List<net.corda.core.contracts.StateRef> inputs, java.util.List<? extends net.corda.core.crypto.SecureHash> attachments, java.util.List<? extends net.corda.core.contracts.TransactionState<? extends net.corda.core.contracts.ContractState>> outputs, java.util.List<net.corda.core.contracts.Command> commands, Party notary, java.util.List<? extends net.corda.core.crypto.CompositeKey> mustSign, TransactionType type, Timestamp timestamp)` Class that holds filtered leaves for a partial Merkle transaction. We assume mixed leaf types, notice that every field from `class WireTransaction` can be used in `class PartialMerkleTree` calculation.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `checkWithFun(kotlin.jvm.functions.Function1<java.lang.Object,java.lang.Boolean> checkingFun)` Function that checks the whole filtered structure. Force type checking on a structure that we obtained, so we don't sign more than expected. Example: Oracle is implemented to check only for commands, if it gets an attachment and doesn't expect it - it can sign over a transaction with the attachment that wasn't verified. Of course it depends on how you implement it, but else -> false should solve a problem with possible later extensions to WireTransaction.
    `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()`

    - ### Methods inherited from interface net.corda.core.transactions.TraversableTransaction

      `getAttachments, getAvailableComponentHashes, getAvailableComponents, getCommands, getInputs, getMustSign, getNotary, getOutputs, getTimestamp, getType`

- - ### Constructor Detail

    - #### FilteredLeaves

          public FilteredLeaves(java.util.List<net.corda.core.contracts.StateRef> inputs,
                                java.util.List<? extends net.corda.core.crypto.SecureHash> attachments,
                                java.util.List<? extends net.corda.core.contracts.TransactionState<? extends net.corda.core.contracts.ContractState>> outputs,
                                java.util.List<net.corda.core.contracts.Command> commands,
                                Party notary,
                                java.util.List<? extends net.corda.core.crypto.CompositeKey> mustSign,
                                TransactionType type,
                                Timestamp timestamp)

      Class that holds filtered leaves for a partial Merkle transaction. We assume mixed leaf types, notice that every field from `class WireTransaction` can be used in `class PartialMerkleTree` calculation.

      See Also:
        `class WireTransaction`, `class PartialMerkleTree`

  - ### Method Detail

    - #### checkWithFun

          public boolean checkWithFun(kotlin.jvm.functions.Function1<java.lang.Object,java.lang.Boolean> checkingFun)

      Function that checks the whole filtered structure. Force type checking on a structure that we obtained, so we don't sign more than expected. Example: Oracle is implemented to check only for commands, if it gets an attachment and doesn't expect it - it can sign over a transaction with the attachment that wasn't verified. Of course it depends on how you implement it, but else -> false should solve a problem with possible later extensions to WireTransaction.

      Parameters:
        `checkingFun` - function that performs type checking on the structure fields and provides verification logic accordingly.

    - #### getInputs

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

    - #### getAttachments

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

    - #### getOutputs

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

    - #### getCommands

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

    - #### getNotary

          public Party getNotary()

    - #### getMustSign

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

    - #### getType

          public TransactionType getType()

    - #### getTimestamp

          public Timestamp getTimestamp()

    - #### getAvailableComponents

          public 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

          public 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.