requireSingleCommand - corda

corda / net.corda.core.contracts / kotlin.collections.Collection / requireSingleCommand

# requireSingleCommand

`fun <reified T : CommandData> Collection<CommandWithParties<CommandData>>.requireSingleCommand(): CommandWithParties<T>`
`fun <C : CommandData> Collection<CommandWithParties<CommandData>>.requireSingleCommand(klass: Class<C>): CommandWithParties<C>`

Ensures that a transaction has only one command that is of the given type, otherwise throws an exception.