Package org.fest.swing.util
Class Strings
java.lang.Object
org.fest.swing.util.Strings
Understands utility methods related to
Strings.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanareEqualOrMatch(String pattern, String s) Indicates if the givenStrings match.static booleanReturns whether the givenStringis the defaulttoString()implementation of anObject.static booleanmatch(Pattern p, CharSequence s) Indicates if the givenCharSequencematches the given regular expression pattern.static booleanIndicates if the givenStringmatches the given regular expression pattern.
-
Constructor Details
-
Strings
private Strings()
-
-
Method Details
-
isDefaultToString
Returns whether the givenStringis the defaulttoString()implementation of anObject.- Parameters:
s- the givenString.- Returns:
trueif the givenStringis the defaulttoString()implementation,falseotherwise.
-
areEqualOrMatch
Indicates if the givenStrings match. To match, one of the following conditions needs to be true:- both
Strings have to be equal smatches the regular expression inpattern
- Parameters:
pattern- aStringto match (it can be a regular expression.)s- theStringto verify.- Returns:
trueif the givenStrings match,falseotherwise.
- both
-
match
Indicates if the givenStringmatches the given regular expression pattern.- Parameters:
p- the given regular expression pattern.s- theStringto evaluate.- Returns:
trueif the givenStringmatches the given regular expression pattern,falseotherwise. It also returnsfalseif the givenStringisnull.- Throws:
NullPointerException- if the given regular expression pattern isnull.
-
match
Indicates if the givenCharSequencematches the given regular expression pattern.- Parameters:
p- the given regular expression pattern.s- theCharSequenceto evaluate.- Returns:
trueif the givenCharSequencematches the given regular expression pattern,falseotherwise. It also returnsfalseif the givenCharSequenceisnull.- Throws:
NullPointerException- if the given regular expression pattern isnull.
-