org.fest.swing.util
Class Strings

java.lang.Object
  extended by org.fest.swing.util.Strings

public final class Strings
extends Object

Understands utility methods related to Strings.

Author:
Alex Ruiz, Uli Schrempp

Method Summary
static boolean areEqualOrMatch(String pattern, String s)
          Indicates if the given Strings match.
static boolean isDefaultToString(String s)
          Returns 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isDefaultToString

public static boolean isDefaultToString(String s)
Returns whether the given String is the default toString() implementation of an Object.

Parameters:
s - the given String.
Returns:
true if the given String is the default toString() implementation, false otherwise.

areEqualOrMatch

public static boolean areEqualOrMatch(String pattern,
                                      String s)
Indicates if the given Strings match. To match, one of the following conditions needs to be true:

Parameters:
pattern - a String to match (it can be a regular expression.)
s - the String to verify.
Returns:
true if the given Strings match, false otherwise.

match

public static boolean match(Pattern p,
                            String s)
Indicates if the given String matches the given regular expression pattern.

Parameters:
p - the given regular expression pattern.
s - the String to evaluate.
Returns:
true if the given String matches the given regular expression pattern, false otherwise. It also returns false if the given String is null.
Throws:
NullPointerException - if the given regular expression pattern is null.

match

public static boolean match(Pattern p,
                            CharSequence s)
Indicates if the given CharSequence matches the given regular expression pattern.

Parameters:
p - the given regular expression pattern.
s - the CharSequence to evaluate.
Returns:
true if the given CharSequence matches the given regular expression pattern, false otherwise. It also returns false if the given CharSequence is null.
Throws:
NullPointerException - if the given regular expression pattern is null.


Copyright © 2007-2011 FEST (Fixtures for Easy Software Testing). All Rights Reserved.