net.corda.contracts.clause

## Class NetClause<C extends CommandData,P>

- Clause
- - net.corda.contracts.clause.NetClause<C,P>

- Direct Known Subclasses:
    Clauses.Net

      public class NetClause<C extends CommandData,P>
      extends Clause

  Clause for netting contract states. Currently only supports obligation contract.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class net.corda.core.contracts.clauses.Clause

      `Clause.Companion`

  - ### Field Summary

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

      `Companion`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `NetClause()` Clause for netting contract states. Currently only supports obligation contract.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.util.Set<java.lang.Class>` | `getRequiredCommands()` Determine whether this clause runs or not
    `java.util.Set<C>` | `verify(TransactionForContract tx, java.util.List<? extends net.corda.core.contracts.ContractState> inputs, java.util.List<? extends net.corda.core.contracts.ContractState> outputs, java.util.List<? extends net.corda.core.contracts.AuthenticatedObject<? extends C>> commands, kotlin.Unit groupingKey)` 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.
    `void` | `verifyNetCommand(java.util.List<net.corda.contracts.asset.Obligation.State> inputs, java.util.List<net.corda.contracts.asset.Obligation.State> outputs, AuthenticatedObject<? extends net.corda.core.contracts.NetCommand> command, NetState<P> netState)` Verify a netting command. This handles both close-out and payment netting.

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

      `getExecutionPath, getRequiredCommands, verify`

- - ### Constructor Detail

    - #### NetClause

          public NetClause()

      Clause for netting contract states. Currently only supports obligation contract.

  - ### Method Detail

    - #### getRequiredCommands

          public java.util.Set<java.lang.Class> getRequiredCommands()

      Determine whether this clause runs or not

    - #### verify

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

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

    - #### verifyNetCommand

          public void verifyNetCommand(java.util.List<net.corda.contracts.asset.Obligation.State> inputs,
                                       java.util.List<net.corda.contracts.asset.Obligation.State> outputs,
                                       AuthenticatedObject<? extends net.corda.core.contracts.NetCommand> command,
                                       NetState<P> netState)

      Verify a netting command. This handles both close-out and payment netting.