/** * Sets a {@link Consumer0} to execute if this matches. */ public FluentMatchingC<T> then(Consumer0 consumer) { return then(fluentMatchingC, consumer); } }
/** * 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> OngoingMatchingC0<T, U> when( DecomposableMatchBuilder0<U> decomposableMatchBuilder) { return new OngoingMatchingC0<>(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> OngoingMatchingC0<T, U> when(MatchesExact<U> o) { List<Matcher<Object>> matchers = Lists.of(ArgumentMatchers.eq(o.t)); return new OngoingMatchingC0<>( this, new DecomposableMatchBuilder0<>(matchers, new IdentityFieldExtractor<U>()).build()); }