Package org.fest.swing.util
Class Strings
java.lang.Object
org.fest.swing.util.Strings
Understands utility methods related to
String
s.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
areEqualOrMatch
(String pattern, String s) Indicates if the givenString
s match.static boolean
Returns whether the givenString
is the defaulttoString()
implementation of anObject
.static boolean
match
(Pattern p, CharSequence s) Indicates if the givenCharSequence
matches the given regular expression pattern.static boolean
Indicates if the givenString
matches the given regular expression pattern.
-
Constructor Details
-
Strings
private Strings()
-
-
Method Details
-
isDefaultToString
Returns whether the givenString
is the defaulttoString()
implementation of anObject
.- Parameters:
s
- the givenString
.- Returns:
true
if the givenString
is the defaulttoString()
implementation,false
otherwise.
-
areEqualOrMatch
Indicates if the givenString
s match. To match, one of the following conditions needs to be true:- both
String
s have to be equal s
matches the regular expression inpattern
- Parameters:
pattern
- aString
to match (it can be a regular expression.)s
- theString
to verify.- Returns:
true
if the givenString
s match,false
otherwise.
- both
-
match
Indicates if the givenString
matches the given regular expression pattern.- Parameters:
p
- the given regular expression pattern.s
- theString
to evaluate.- Returns:
true
if the givenString
matches the given regular expression pattern,false
otherwise. It also returnsfalse
if the givenString
isnull
.- Throws:
NullPointerException
- if the given regular expression pattern isnull
.
-
match
Indicates if the givenCharSequence
matches the given regular expression pattern.- Parameters:
p
- the given regular expression pattern.s
- theCharSequence
to evaluate.- Returns:
true
if the givenCharSequence
matches the given regular expression pattern,false
otherwise. It also returnsfalse
if the givenCharSequence
isnull
.- Throws:
NullPointerException
- if the given regular expression pattern isnull
.
-