public class StringUtils extends Object
toUtf8(String)
and fromUtf8(byte[])
.Modifier and Type | Field and Description |
---|---|
static byte[] |
EMPTY_BYTES |
static Charset |
UTF8_CHARSET
Deprecated.
|
static String |
UTF8_STRING |
Constructor and Description |
---|
StringUtils() |
Modifier and Type | Method and Description |
---|---|
static int |
estimatedBinaryLengthAsUTF8(String value) |
static String |
format(String message,
Object... formatArgs)
Equivalent of String.format(Locale.ENGLISH, message, formatArgs).
|
static String |
fromUtf8(byte[] bytes) |
static String |
fromUtf8(ByteBuffer buffer) |
static String |
fromUtf8(ByteBuffer buffer,
int numBytes) |
static String |
nonStrictFormat(String message,
Object... formatArgs)
Formats the string as
format(String, Object...) , but instead of failing on illegal format, returns the
concatenated format string and format arguments. |
static String |
removeChar(String s,
char c) |
static String |
toLowerCase(String s) |
static String |
toUpperCase(String s) |
static byte[] |
toUtf8(String string) |
static byte[] |
toUtf8WithNullToEmpty(String string) |
public static final byte[] EMPTY_BYTES
@Deprecated public static final Charset UTF8_CHARSET
public static final String UTF8_STRING
public static int estimatedBinaryLengthAsUTF8(String value)
public static byte[] toUtf8WithNullToEmpty(String string)
public static String fromUtf8(byte[] bytes)
public static String fromUtf8(ByteBuffer buffer, int numBytes)
public static String fromUtf8(ByteBuffer buffer)
public static byte[] toUtf8(String string)
public static String format(String message, Object... formatArgs)
public static String nonStrictFormat(String message, Object... formatArgs)
format(String, Object...)
, but instead of failing on illegal format, returns the
concatenated format string and format arguments. Should be used for unimportant formatting like logging,
exception messages, typically not directly.Copyright © 2011–2018. All rights reserved.