public class FilterOn<S extends ContractState,C extends CommandData,K>
extends Clause
Filter the states that are passed through to the wrapped clause, to restrict them to a specific type.
Clause.Companion
Constructor and Description |
---|
FilterOn(Clause<? super S,C,? super K> clause,
kotlin.jvm.functions.Function1<? super java.util.List<? extends net.corda.core.contracts.ContractState>,? extends java.util.List<? extends S>> filterStates)
Filter the states that are passed through to the wrapped clause, to restrict them to a specific type.
|
Modifier and Type | Method and Description |
---|---|
Clause<S,C,K> |
getClause() |
java.util.List<net.corda.core.contracts.clauses.Clause> |
getExecutionPath(java.util.List<? extends net.corda.core.contracts.AuthenticatedObject<? extends C>> commands)
Determine the subclauses which will be verified as a result of verifying this clause.
|
kotlin.jvm.functions.Function1<java.util.List,java.util.List> |
getFilterStates() |
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,
K 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.
|
getExecutionPath, getRequiredCommands, verify
public FilterOn(Clause<? super S,C,? super K> clause, kotlin.jvm.functions.Function1<? super java.util.List<? extends net.corda.core.contracts.ContractState>,? extends java.util.List<? extends S>> filterStates)
Filter the states that are passed through to the wrapped clause, to restrict them to a specific type.
public java.util.Set<java.lang.Class> getRequiredCommands()
Determine whether this clause runs or not
public java.util.List<net.corda.core.contracts.clauses.Clause> getExecutionPath(java.util.List<? extends net.corda.core.contracts.AuthenticatedObject<? extends C>> commands)
Determine the subclauses which will be verified as a result of verifying this clause.
class FirstOf
).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, K 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.
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
.public Clause<S,C,K> getClause()
public kotlin.jvm.functions.Function1<java.util.List,java.util.List> getFilterStates()