/** * Specifies an match on a decomposing matcher with 0 extracted fields and then returns a fluent * interface for specifying the action to take if the value matches this case. */ public <U extends T> OngoingMatchingR0<T, U, R> when( DecomposableMatchBuilder0<U> decomposableMatchBuilder) { return new OngoingMatchingR0<>(this, decomposableMatchBuilder.build()); }
/** * Specifies an exact match and then returns a fluent interface for specifying the action to take * if the value matches this case. */ public <U extends T> OngoingMatchingR0<T, U, R> when(MatchesExact<U> o) { List<Matcher<Object>> matchers = Lists.of(ArgumentMatchers.eq(o.t)); return new OngoingMatchingR0<>( this, new DecomposableMatchBuilder0<>(matchers, new IdentityFieldExtractor<U>()).build()); }