|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.maven.surefire.util.internal.StringUtils
public class StringUtils
Common String manipulation routines.
Originally from Turbine and the GenerationJavaCore library.
| Constructor Summary | |
|---|---|
StringUtils()
|
|
| Method Summary | |
|---|---|
static int |
escapeBytesToPrintable(byte[] out,
int outoff,
byte[] input,
int off,
int len)
Escapes the bytes in the array str to contain only 'printable' bytes. |
static void |
escapeToPrintable(StringBuilder target,
CharSequence str)
Escape the specified string to a representation that only consists of nicely printable characters, without any newlines and without a comma. |
static boolean |
isBlank(String str)
Checks if a (trimmed) String is null or blank. |
static String[] |
split(String text,
String separator)
|
static int |
unescapeBytes(byte[] out,
String str)
Reverses the effect of escapeBytesToPrintable(byte[], int, byte[], int, int). |
static void |
unescapeString(StringBuilder target,
CharSequence str)
Reverses the effect of escapeToPrintable(StringBuilder, CharSequence). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StringUtils()
| Method Detail |
|---|
public static String[] split(String text,
String separator)
public static boolean isBlank(String str)
Checks if a (trimmed) String is null or blank.
str - the String to check
true if the String is null, or length zero once trimmed
public static void escapeToPrintable(StringBuilder target,
CharSequence str)
The reverse-method is unescapeString(StringBuilder, CharSequence).
target - target string buffer. The required space will be up to str.getBytes().length * 5 chars.str - String to escape values in, may be null.
public static void unescapeString(StringBuilder target,
CharSequence str)
escapeToPrintable(StringBuilder, CharSequence).
target - target string bufferstr - the String to un-escape, as created by escapeToPrintable(StringBuilder, CharSequence)
public static int escapeBytesToPrintable(byte[] out,
int outoff,
byte[] input,
int off,
int len)
str to contain only 'printable' bytes.
Escaping is done by encoding the non-nicely printable bytes to '\' + upperCaseHexBytes(byte).
A save length of out is len * 3 + outoff.
The reverse-method is unescapeBytes(byte[], String).
out - output bufferoutoff - offset in the output bufferinput - input bufferoff - offset in the input bufferlen - number of bytes to copy from the input buffer
out
public static int unescapeBytes(byte[] out,
String str)
escapeBytesToPrintable(byte[], int, byte[], int, int).
A save length of out is str.length()
out - the target byte arraystr - the input String
out
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||