net.corda.core.contracts.clauses

## Class FirstComposition<S extends ContractState,C extends CommandData,K>

- Clause
- - CompositeClause
  - - net.corda.core.contracts.clauses.FirstComposition<S,C,K>

- Deprecated.

      public class FirstComposition<S extends ContractState,C extends CommandData,K>
      extends CompositeClause

  Compose a number of clauses, such that the first match is run, and it errors if none is run.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `FirstComposition.Companion` Deprecated.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static FirstComposition.Companion` | `Companion` Deprecated.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `FirstComposition(Clause<? super S,C,? super K> firstClause, net.corda.core.contracts.clauses.Clause remainingClauses)` Deprecated. Compose a number of clauses, such that the first match is run, and it errors if none is run.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.util.ArrayList<net.corda.core.contracts.clauses.Clause>` | `getClauses()` Deprecated. List of clauses under this composite clause
    `Clause<S,C,K>` | `getFirstClause()` Deprecated.
    `java.util.List<net.corda.core.contracts.clauses.Clause>` | `matchedClauses(java.util.List<? extends net.corda.core.contracts.AuthenticatedObject<? extends C>> commands)` Deprecated. Determine which clauses are matched by the supplied commands.
    `java.lang.String` | `toString()` Deprecated.
    `java.util.Set<C>` | `verify(TransactionForContract tx, java.util.List<? extends S> inputs, java.util.List<? extends S> outputs, java.util.List<? extends net.corda.core.contracts.AuthenticatedObject<? extends C>> commands, K groupingKey)` Deprecated. Verify the transaction matches the conditions from this clause. For example, a "no zero amount output" clause would check each of the output states that it applies to, looking for a zero amount, and throw IllegalStateException if any matched.

    - ### Methods inherited from class net.corda.core.contracts.clauses.CompositeClause

      `getClauses, getExecutionPath, matchedClauses`

    - ### Methods inherited from class net.corda.core.contracts.clauses.Clause

      `getExecutionPath, getRequiredCommands, verify`

- - ### Field Detail

    - #### Companion

          public static FirstComposition.Companion Companion

      Deprecated.

  - ### Constructor Detail

    - #### FirstComposition

          public FirstComposition(Clause<? super S,C,? super K> firstClause,
                                  net.corda.core.contracts.clauses.Clause remainingClauses)

      Deprecated.

      Compose a number of clauses, such that the first match is run, and it errors if none is run.

  - ### Method Detail

    - #### getClauses

          public java.util.ArrayList<net.corda.core.contracts.clauses.Clause> getClauses()

      Deprecated.

      List of clauses under this composite clause

    - #### matchedClauses

          public java.util.List<net.corda.core.contracts.clauses.Clause> matchedClauses(java.util.List<? extends net.corda.core.contracts.AuthenticatedObject<? extends C>> commands)

      Deprecated.

      Determine which clauses are matched by the supplied commands.

      Throws:
        - if the given commands do not result in a valid execution (for example no match with `class FirstOf`).

    - #### verify

          public java.util.Set<C> verify(TransactionForContract tx,
                                         java.util.List<? extends S> inputs,
                                         java.util.List<? extends S> outputs,
                                         java.util.List<? extends net.corda.core.contracts.AuthenticatedObject<? extends C>> commands,
                                         K groupingKey)

      Deprecated.

      Verify the transaction matches the conditions from this clause. For example, a "no zero amount output" clause would check each of the output states that it applies to, looking for a zero amount, and throw IllegalStateException if any matched.

      Parameters:
        `tx` - the full transaction being verified. This is provided for cases where clauses need to access states or commands outside of their normal scope.
        `inputs` - input states which are relevant to this clause. By default this is the set passed into verifyClause, but may be further reduced by clauses such as `class GroupClauseVerifier`.
        `outputs` - output states which are relevant to this clause. By default this is the set passed into verifyClause, but may be further reduced by clauses such as `class GroupClauseVerifier`.
        `commands` - commands which are relevant to this clause. By default this is the set passed into verifyClause, but may be further reduced by clauses such as `class GroupClauseVerifier`.
        `groupingKey` - a grouping key applied to states and commands, where applicable. Taken from `class TransactionForContract.InOutGroup`.
      Returns:
        the set of commands that are consumed IF this clause is matched, and cannot be used to match a later clause. This would normally be all commands matching "requiredCommands" for this clause, but some verify() functions may do further filtering on possible matches, and return a subset. This may also include commands that were not required (for example the Exit command for fungible assets is optional).

    - #### toString

          public java.lang.String toString()

      Deprecated.

    - #### getFirstClause

          public Clause<S,C,K> getFirstClause()

      Deprecated.