Class Re2jSubjects.Re2jStringSubject
- java.lang.Object
-
- com.google.common.truth.Subject
-
- com.google.common.truth.extensions.re2j.Re2jSubjects.Re2jStringSubject
-
- Enclosing class:
- Re2jSubjects
public static final class Re2jSubjects.Re2jStringSubject extends Subject
Subject forString
subjects which you can use to assert things aboutPattern
regexes.- See Also:
Re2jSubjects.re2jString()
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.common.truth.Subject
Subject.Factory<SubjectT extends Subject,ActualT>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
actualCustomStringRepresentation()
Returns a string representation of the actual value for inclusion in failure messages.void
containsMatch(com.google.re2j.Pattern pattern)
Fails if the string does not contain a match on the given regex.void
containsMatch(String regex)
Fails if the string does not contain a match on the given regex.void
doesNotContainMatch(com.google.re2j.Pattern pattern)
Fails if the string contains a match on the given regex.void
doesNotContainMatch(String regex)
Fails if the string contains a match on the given regex.void
doesNotMatch(com.google.re2j.Pattern regex)
Fails if the string matches the given regex.void
doesNotMatch(String regex)
Fails if the string matches the given regex.void
matches(com.google.re2j.Pattern regex)
Fails if the string does not match the given regex.void
matches(String regex)
Fails if the string does not match the given regex.-
Methods inherited from class com.google.common.truth.Subject
check, equals, failWithActual, failWithActual, failWithoutActual, hashCode, ignoreCheck, isAnyOf, isEqualTo, isIn, isInstanceOf, isNoneOf, isNotEqualTo, isNotIn, isNotInstanceOf, isNotNull, isNotSameInstanceAs, isNull, isSameInstanceAs, toString
-
-
-
-
Method Detail
-
actualCustomStringRepresentation
protected String actualCustomStringRepresentation()
Description copied from class:Subject
Returns a string representation of the actual value for inclusion in failure messages.Subjects should override this with care.
By default, this method returns
String.valueOf(getActualValue())
for most types. It does have some special logic for a few cases, like arrays.- Overrides:
actualCustomStringRepresentation
in classSubject
-
matches
public void matches(String regex)
Fails if the string does not match the given regex.
-
matches
@GwtIncompatible("com.google.re2j.Pattern") public void matches(com.google.re2j.Pattern regex)
Fails if the string does not match the given regex.
-
doesNotMatch
public void doesNotMatch(String regex)
Fails if the string matches the given regex.
-
doesNotMatch
@GwtIncompatible("com.google.re2j.Pattern") public void doesNotMatch(com.google.re2j.Pattern regex)
Fails if the string matches the given regex.
-
containsMatch
@GwtIncompatible("com.google.re2j.Pattern") public void containsMatch(com.google.re2j.Pattern pattern)
Fails if the string does not contain a match on the given regex.
-
containsMatch
public void containsMatch(String regex)
Fails if the string does not contain a match on the given regex.
-
doesNotContainMatch
@GwtIncompatible("com.google.re2j.Pattern") public void doesNotContainMatch(com.google.re2j.Pattern pattern)
Fails if the string contains a match on the given regex.
-
doesNotContainMatch
public void doesNotContainMatch(String regex)
Fails if the string contains a match on the given regex.
-
-