org.mule.util
Class StringUtils

java.lang.Object
  extended byorg.apache.commons.lang.StringUtils
      extended byorg.mule.util.StringUtils

public class StringUtils
extends StringUtils

StringUtils contains useful methods for manipulating Strings.

See Also:
Serialized Form

Constructor Summary
StringUtils()
           
 
Method Summary
static byte[] hexStringToByteArray(String hex)
          Convert a hexadecimal string into its byte representation.
static String repeat(char c, int len)
          Like #repeat(String, int) but with a single character as argument.
static String[] splitAndTrim(String string, String delim)
          Like StringUtils, but additionally trims whitespace from the result tokens.
static String toHexString(byte[] bytes)
           
static String toHexString(byte[] bytes, boolean uppercase)
          Convert a byte array to a hexadecimal string.
 
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

splitAndTrim

public static String[] splitAndTrim(String string,
                                    String delim)
Like StringUtils, but additionally trims whitespace from the result tokens.


hexStringToByteArray

public static byte[] hexStringToByteArray(String hex)
Convert a hexadecimal string into its byte representation.

Parameters:
hex - The hexadecimal string.
Returns:
The converted bytes or null if the hex String is null.

repeat

public static String repeat(char c,
                            int len)
Like #repeat(String, int) but with a single character as argument.


toHexString

public static String toHexString(byte[] bytes)
See Also:
toHexString(byte[])

toHexString

public static String toHexString(byte[] bytes,
                                 boolean uppercase)
Convert a byte array to a hexadecimal string.

Parameters:
bytes - The bytes to format.
uppercase - When true creates uppercase hex characters instead of lowercase (the default).
Returns:
A hexadecimal representation of the specified bytes.


Copyright © 2003-2006 MuleSource Inc.. All Rights Reserved.