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