corda / net.corda.core.transactions / LedgerTransaction / filterReferenceInputRefs

filterReferenceInputRefs

fun <T : ContractState> filterReferenceInputRefs(clazz: Class<T>, predicate: Predicate<T>): List<StateAndRef<T>>

Helper to simplify filtering reference inputs according to a Predicate.

Parameters

predicate - A filtering function taking a state of type T and returning true if it should be included in the list. The class filtering is applied before the predicate.

clazz - The class type used for filtering via an Class.isInstance check. clazz must be an extension of ContractState.

Return
the possibly empty list of references StateAndRef matching the predicate and clazz restrictions.

inline fun <reified T : ContractState> filterReferenceInputRefs(crossinline predicate: (T) -> Boolean): List<StateAndRef<T>>