-
CSR
-
Resolution: Approved
-
P3
-
None
-
minimal
-
Java API
-
SE
Summary
A new method Pattern.asMatchPredicate
that converts a pattern into a predicate using Matcher.matches
.
Problem
A method that converts a pattern into a predicate using Matcher.find
already exists. It would be helpful to have a similar method that creates a predicate using Matcher.matches
.
Solution
A new method that produces a predicate using the semantics of Matcher.match
.
Specification
/** + * Creates a predicate that tests if this pattern matches a given input string. + * + * @apiNote + * This method creates a predicate that behaves as if it creates a matcher + * from the input sequence and then calls {@code matches}, for example a + * predicate of the form: + * {@code + * s -> matcher(s).matches(); + * } + * + * @return The predicate which can be used for matching an input string + * against this pattern. + * @since 11 + * @see Matcher#matches + */
- csr of
-
JDK-8184692 add Pattern.asMatchPredicate
-
- Resolved
-