Skip to content

Commit f89f8e1

Browse files
committed
Add Javadoc for factory methods.
1 parent c7f83db commit f89f8e1

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎hamcrest-library/src/main/java/org/hamcrest/text/MatchesPattern.java‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,19 @@ public void describeTo(Description description) {
2424
description.appendText("a string matching the pattern '" + pattern + "'");
2525
}
2626

27+
/**
28+
* Creates a matcher of {@link String} that matches when the examined string
29+
* exactly matches the given {@link Pattern}.
30+
*/
2731
@Factory
2832
public static Matcher<String> matchesPattern(Pattern pattern) {
2933
return new MatchesPattern(pattern);
3034
}
3135

36+
/**
37+
* Creates a matcher of {@link String} that matches when the examined string
38+
* exactly matches the given regular expression, treated as a {@link Pattern}.
39+
*/
3240
@Factory
3341
public static Matcher<String> matchesPattern(String regex) {
3442
return new MatchesPattern(Pattern.compile(regex));

0 commit comments

Comments
 (0)