public final class StringUtil extends Object
Modifier and Type | Field and Description |
---|---|
static char |
CARRIAGE_RETURN |
static char |
COMMA |
static char |
DOUBLE_QUOTE |
static String |
EMPTY_STRING |
static char |
LINE_FEED |
static String |
NEWLINE |
Modifier and Type | Method and Description |
---|---|
static String |
byteToHexString(int value)
Converts the specified byte value into a hexadecimal integer.
|
static <T extends Appendable> |
byteToHexString(T buf,
int value)
Converts the specified byte value into a hexadecimal integer and appends it to the specified buffer.
|
static String |
byteToHexStringPadded(int value)
Converts the specified byte value into a 2-digit hexadecimal integer.
|
static <T extends Appendable> |
byteToHexStringPadded(T buf,
int value)
Converts the specified byte value into a 2-digit hexadecimal integer and appends it to the specified buffer.
|
static String |
simpleClassName(Class<?> clazz)
Generates a simplified name from a
Class . |
static String |
simpleClassName(Object o)
The shortcut to
simpleClassName(o.getClass()) . |
static String[] |
split(String value,
char delim)
Splits the specified
String with the specified delimiter. |
static String[] |
split(String value,
char delim,
int maxParts)
Splits the specified
String with the specified delimiter in maxParts maximum parts. |
static String |
substringAfter(String value,
char delim)
Get the item after one char delim if the delim is found (else null).
|
static String |
toHexString(byte[] src)
Converts the specified byte array into a hexadecimal value.
|
static String |
toHexString(byte[] src,
int offset,
int length)
Converts the specified byte array into a hexadecimal value.
|
static <T extends Appendable> |
toHexString(T dst,
byte[] src)
Converts the specified byte array into a hexadecimal value and appends it to the specified buffer.
|
static <T extends Appendable> |
toHexString(T dst,
byte[] src,
int offset,
int length)
Converts the specified byte array into a hexadecimal value and appends it to the specified buffer.
|
static String |
toHexStringPadded(byte[] src)
Converts the specified byte array into a hexadecimal value.
|
static String |
toHexStringPadded(byte[] src,
int offset,
int length)
Converts the specified byte array into a hexadecimal value.
|
static <T extends Appendable> |
toHexStringPadded(T dst,
byte[] src)
Converts the specified byte array into a hexadecimal value and appends it to the specified buffer.
|
static <T extends Appendable> |
toHexStringPadded(T dst,
byte[] src,
int offset,
int length)
Converts the specified byte array into a hexadecimal value and appends it to the specified buffer.
|
public static final String NEWLINE
public static final char DOUBLE_QUOTE
public static final char COMMA
public static final char LINE_FEED
public static final char CARRIAGE_RETURN
public static final String EMPTY_STRING
public static String[] split(String value, char delim)
String
with the specified delimiter. This operation is a simplified and optimized
version of String.split(String)
.public static String[] split(String value, char delim, int maxParts)
String
with the specified delimiter in maxParts maximum parts.
This operation is a simplified and optimized
version of String.split(String, int)
.public static String substringAfter(String value, char delim)
String.split(String, int)
.public static String byteToHexStringPadded(int value)
public static <T extends Appendable> T byteToHexStringPadded(T buf, int value)
public static String toHexStringPadded(byte[] src)
public static String toHexStringPadded(byte[] src, int offset, int length)
public static <T extends Appendable> T toHexStringPadded(T dst, byte[] src)
public static <T extends Appendable> T toHexStringPadded(T dst, byte[] src, int offset, int length)
public static String byteToHexString(int value)
public static <T extends Appendable> T byteToHexString(T buf, int value)
public static String toHexString(byte[] src)
public static String toHexString(byte[] src, int offset, int length)
public static <T extends Appendable> T toHexString(T dst, byte[] src)
public static <T extends Appendable> T toHexString(T dst, byte[] src, int offset, int length)
public static String simpleClassName(Object o)
simpleClassName(o.getClass())
.public static String simpleClassName(Class<?> clazz)
Class
. Similar to Class.getSimpleName()
, but it works fine
with anonymous classes.Copyright © 2008–2015 The Netty Project. All rights reserved.