StubPredicate

SAM-convertible predicate over a StubHandle.

Used by MokksyServer.findStub and MokksyServer.findStubs to filter registered stubs by arbitrary criteria beyond exact name or id lookup.

Backed by fun interface so it is also SAM-convertible from a Kotlin lambda:

mokksy.findStubs { it.matchCount() == 0 && it.name?.startsWith("test-") == true }

Java callers can use a lambda expression:

mokksy.findStubs(stub -> stub.matchCount() == 0);

Functions

Link copied to clipboard
abstract fun test(stub: StubHandle): Boolean

Returns true to include this StubHandle in the result set.