org.eclipse.swtbot.swt.finder.utils
Class StringUtils

java.lang.Object
  extended by org.eclipse.swtbot.swt.finder.utils.StringUtils

public class StringUtils
extends Object

A set of utilities for string manipulation.

Since:
1.0
Version:
$Id$
Author:
Ketan Padegaonkar <KetanPadegaonkar [at] gmail [dot] com>

Constructor Summary
StringUtils()
           
 
Method Summary
static String capitalize(String string)
          Converts the string to capitalized.
static boolean isEmpty(String text)
           
static boolean isEmptyOrNull(String string)
          Checks if the given string is null or empty.
static boolean isNull(String text)
           
static String join(Collection<?> toJoin, String delimiter)
          Joins a collection of objects using the given delimiter as spacing.
static String join(Collection<?> toJoin, String delimiter, StringConverter converter)
          Joins a collection of objects using the given delimiter as spacing.
static String join(int[] toJoin, String delimiter)
          Joins the given integer array with the given delimiter.
static String join(Object[] toJoin, String delimiter)
          Joins an array of objects using the given delimiter as spacing.
static String join(Object[] toJoin, String delimiter, StringConverter converter)
          Joins an array of objects using the given delimiter as spacing.
static String toCamelCase(String string)
          Converts the string to camelcase.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringUtils

public StringUtils()
Method Detail

join

public static String join(Object[] toJoin,
                          String delimiter)
Joins an array of objects using the given delimiter as spacing.

Parameters:
toJoin - the objects to join into a string.
delimiter - the delimiter used to join the objects.
Returns:
the result of joining the toJoin with delimiter.

join

public static String join(Object[] toJoin,
                          String delimiter,
                          StringConverter converter)
Joins an array of objects using the given delimiter as spacing.

Parameters:
toJoin - the objects to join into a string.
delimiter - the delimiter used to join the objects.
converter - the converter that can convert objects in the collection into strings.
Returns:
the result of joining the toJoin with delimiter.

join

public static String join(Collection<?> toJoin,
                          String delimiter)
Joins a collection of objects using the given delimiter as spacing.

Parameters:
toJoin - the objects to join into a string.
delimiter - the delimiter used to join the objects.
Returns:
the result of joining the toJoin with delimiter.

join

public static String join(Collection<?> toJoin,
                          String delimiter,
                          StringConverter converter)
Joins a collection of objects using the given delimiter as spacing.

Parameters:
toJoin - the objects to join into a string.
delimiter - the delimiter used to join the objects.
converter - the converter that can convert objects in the collection into strings.
Returns:
the result of joining the toJoin with delimiter.

isEmptyOrNull

public static boolean isEmptyOrNull(String string)
Checks if the given string is null or empty.

Parameters:
string - the string.
Returns:
true if string is null, blank or whitespaces. false otherwise.

join

public static String join(int[] toJoin,
                          String delimiter)
Joins the given integer array with the given delimiter.

Parameters:
toJoin - the integers to join into a string.
delimiter - the delimiter.
Returns:
the result of joining the toJoin with delimiter.

isEmpty

public static boolean isEmpty(String text)
Parameters:
text - the text.
Returns:
true if the text is empty, false otherwise.
Since:
1.3

isNull

public static boolean isNull(String text)
Parameters:
text - the text.
Returns:
true if the text is null, false otherwise.
Since:
1.3

toCamelCase

public static String toCamelCase(String string)
Converts the string to camelcase. Strings are of the format: THIS_IS_A_STRING, and the result of camel casing would be thisIsAString.

Parameters:
string - the string to be camelcased.
Returns:
the camel cased string.
Since:
2.0

capitalize

public static String capitalize(String string)
Converts the string to capitalized. Strings are of the format: THIS_IS_A_STRING, and the result of capitalization would be ThisIsAString.

Parameters:
string - the string to capitalize.
Returns:
the capitalized string.
Since:
2.0