public final class Strings extends Object
String
s.Modifier and Type | Method and Description |
---|---|
static boolean |
areEqualOrMatch(String pattern,
String s)
Indicates if the given
String s match. |
static boolean |
isDefaultToString(String s)
Indicates whether the given
String is the default toString() implementation of an Object . |
static boolean |
isNullOrEmpty(String s)
Indicates whether the given
String is null or empty. |
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)
String
s match. To match, one of the following conditions needs to be true:
String
s have to be equals
matches the regular expression in pattern
pattern
- a String
to match (it can be a regular expression).s
- the String
to verify.true
if the given String
s 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
.public static boolean isNullOrEmpty(String s)
String
is null
or empty.s
- the String
to check.true
if the given String
is null
or empty, otherwise false
.Copyright © 2014–2019 AssertJ. All rights reserved.