contramap<R> method

  1. @nonVirtual
Spec<R> contramap<R>(
  1. T projection(
    1. R candidate
    )
)

Adapts this spec to candidates of type R using projection.

The projection runs for each evaluation, and the resulting value is checked by this spec.

Implementation

@nonVirtual
Spec<R> contramap<R>(T Function(R candidate) projection) =>
    .predicate((candidate) => isSatisfiedBy(projection(candidate)));