public class PatternTextMatcher extends Object implements TextMatcher
String
values. Matching is perform by equality or by regular expression matching.Constructor and Description |
---|
PatternTextMatcher(Pattern... patterns)
Creates a new
PatternTextMatcher . |
Modifier and Type | Method and Description |
---|---|
String |
description() |
String |
formattedValues() |
boolean |
isMatching(String text)
Indicates whether the given text matches the regular expression patterns in this matcher.
|
public PatternTextMatcher(@Nonnull Pattern... patterns)
PatternTextMatcher
.patterns
- the regular expression patterns to match.NullPointerException
- if the array of patterns is null
.IllegalArgumentException
- if the array of patterns is empty.public boolean isMatching(@Nullable String text)
isMatching
in interface TextMatcher
text
- the text to verify.true
if the given text matches the Pattern
values in this matcher, false
otherwise.NullPointerException
- if any of the regular expressions is null
.@Nonnull public String description()
description
in interface TextMatcher
@Nonnull public String formattedValues()
formattedValues
in interface TextMatcher
String
.Copyright © 2014–2019 AssertJ. All rights reserved.