org.mentawai.util
Class StringUtils

java.lang.Object
  extended by org.mentawai.util.StringUtils

public class StringUtils
extends Object


Field Summary
static Pattern[] PATTERNS
           
static String[] REPLACES
           
 
Constructor Summary
StringUtils()
           
 
Method Summary
static String fromBytesToHex(byte[] b)
           
static byte[] fromHexToBytes(String hex)
           
static String fromHexToString(String hex)
           
static String fromStringToHex(String s)
           
static String invert(String s)
           
static boolean isEmpty(String str)
          Checks if String is null or empty.
static boolean isNotEmpty(String s)
           
static Number parseCurrencyNumber(String value, Locale loc)
          Convert Money value as String to a Number
static String randomNumber(int size)
           
static String randomString(int size)
           
static String randomString(int size, boolean onlyChars)
           
static String randomString(int size, boolean onlyChars, boolean upcase)
           
static String removeAccents(String text)
           
static String[] slice(String line)
          Turns a line with strings separated by one or more spaces into a String array.
static String[] split(String line)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REPLACES

public static String[] REPLACES

PATTERNS

public static Pattern[] PATTERNS
Constructor Detail

StringUtils

public StringUtils()
Method Detail

isNotEmpty

public static boolean isNotEmpty(String s)

isEmpty

public static boolean isEmpty(String str)
Checks if String is null or empty.

Parameters:
str - String
Returns:
boolean

slice

public static String[] slice(String line)
Turns a line with strings separated by one or more spaces into a String array.

Parameters:
line - The line to be sliced
Returns:
A String array with the slices

split

public static String[] split(String line)

randomString

public static String randomString(int size)

randomString

public static String randomString(int size,
                                  boolean onlyChars)

randomNumber

public static String randomNumber(int size)

randomString

public static String randomString(int size,
                                  boolean onlyChars,
                                  boolean upcase)

fromBytesToHex

public static String fromBytesToHex(byte[] b)

fromHexToBytes

public static byte[] fromHexToBytes(String hex)

fromHexToString

public static String fromHexToString(String hex)

fromStringToHex

public static String fromStringToHex(String s)

invert

public static String invert(String s)

parseCurrencyNumber

public static Number parseCurrencyNumber(String value,
                                         Locale loc)
                                  throws ParseException
Convert Money value as String to a Number

Parameters:
value -
loc - (Optional) Default is LocaleManager.DEFAULT_LOCALE
Throws:
ParseException

removeAccents

public static String removeAccents(String text)


Copyright © 2013. All Rights Reserved.