de.danielbechler.util
Class Strings

java.lang.Object
  extended by de.danielbechler.util.Strings

public class Strings
extends Object

Author:
Daniel Bechler

Method Summary
static String capitalize(String s)
           
static boolean hasText(String s)
           
static String indent(int times, String text)
           
static boolean isEmpty(String s)
           
static String join(String delimiter, Collection<?> elements)
          Same as join(String, Object...) but with a Collection instead of an Array for the elements.
static String join(String delimiter, Object... elements)
          Joins all non-null elements of the given elements into one String.
static String toPropertyExpression(String s)
           
static String toSingleLineString(Object object)
           
static String toUnderscoreCase(String s)
          Converts a camel-cased character sequence (e.g.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

hasText

public static boolean hasText(String s)

isEmpty

public static boolean isEmpty(String s)

capitalize

public static String capitalize(String s)

toPropertyExpression

public static String toPropertyExpression(String s)

toUnderscoreCase

public static String toUnderscoreCase(String s)
Converts a camel-cased character sequence (e.g. ThisIsSparta) into underscore-case (e.g. this_is_sparta).

Parameters:
s - The text to convert.
Returns:
A underscore-cased version of the given text.

join

public static String join(String delimiter,
                          Object... elements)
Joins all non-null elements of the given elements into one String.

Parameters:
delimiter - Inserted as separator between consecutive elements.
elements - The elements to join.
Returns:
A long string containing all non-null elements.

join

public static String join(String delimiter,
                          Collection<?> elements)
Same as join(String, Object...) but with a Collection instead of an Array for the elements.

See Also:
join(String, java.util.Collection)

toSingleLineString

public static String toSingleLineString(Object object)

indent

public static String indent(int times,
                            String text)


Copyright © 2012. All Rights Reserved.