public final class Strings extends Object
Strings.| Modifier and Type | Method and Description |
|---|---|
static boolean |
areEqualOrMatch(String pattern,
String s)
Indicates if the given
Strings match. |
static boolean |
isDefaultToString(String s)
Indicates whether the given
String is the default toString() implementation of an Object. |
static boolean |
match(Pattern p,
CharSequence s)
Indicates if the given
CharSequence matches the given regular expression pattern. |
static boolean |
match(Pattern p,
String s)
Indicates if the given
String matches the given regular expression pattern. |
public static boolean isDefaultToString(@Nullable String s)
String is the default toString() implementation of an Object.s - the given String.true if the given String is the default toString() implementation, false
otherwise.public static boolean areEqualOrMatch(@Nullable String pattern, @Nullable String s)
Strings match. To match, one of the following conditions needs to be true:
Strings have to be equals matches the regular expression in patternpattern - a String to match (it can be a regular expression.)s - the String to verify.true if the given Strings match, false otherwise.public static boolean match(@Nonnull Pattern p, @Nullable String s)
String matches the given regular expression pattern.p - the given regular expression pattern.s - the String to evaluate.true if the given String matches the given regular expression pattern, false
otherwise. It also returns false if the given String is null.NullPointerException - if the given regular expression pattern is null.public static boolean match(@Nonnull Pattern p, @Nullable CharSequence s)
CharSequence matches the given regular expression pattern.p - the given regular expression pattern.s - the CharSequence to evaluate.true if the given CharSequence matches the given regular expression pattern, false
otherwise. It also returns false if the given CharSequence is null.NullPointerException - if the given regular expression pattern is null.Copyright © 2014 AssertJ. All rights reserved.