public final class StringUtils extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static String[] |
EMPTY_STRING_ARRAY |
| 限定符和类型 | 方法和说明 |
|---|---|
static String |
bytes2HexShortString(org.apache.ratis.thirdparty.com.google.protobuf.ByteString bytes) |
static String |
bytes2HexString(byte[] bytes) |
static String |
bytes2HexString(byte[] bytes,
int offset,
int length) |
static String |
bytes2HexString(ByteBuffer bytes) |
static String |
bytes2HexString(org.apache.ratis.thirdparty.com.google.protobuf.ByteString bytes) |
static String |
completableFuture2String(CompletableFuture<?> future,
boolean includeDetails) |
static String |
currentDateTime() |
static String |
format(String format,
Object... objects)
The same as String.format(Locale.ENGLISH, format, objects).
|
static String[] |
getTrimmedStrings(String s)
Splits the given comma separated
String. |
static <K,V> String |
map2String(Map<K,V> map) |
static boolean |
string2boolean(String s,
boolean defaultValue) |
static String |
stringifyException(Throwable e) |
static StringSupplier |
stringSupplierAsObject(Supplier<String> supplier) |
static String |
weakIntern(String sample)
Interns and returns a reference to the representative instance
for any of a collection of string instances that are equal to each other.
|
public static final String[] EMPTY_STRING_ARRAY
public static String currentDateTime()
public static String weakIntern(String sample)
sample - string instance to be internedpublic static String[] getTrimmedStrings(String s)
String.
Each split value is trimmed.s - a comma separated String, or possibly null.public static String format(String format, Object... objects)
public static String bytes2HexShortString(org.apache.ratis.thirdparty.com.google.protobuf.ByteString bytes)
public static String bytes2HexString(org.apache.ratis.thirdparty.com.google.protobuf.ByteString bytes)
public static String bytes2HexString(byte[] bytes)
public static String bytes2HexString(byte[] bytes, int offset, int length)
public static String bytes2HexString(ByteBuffer bytes)
public static boolean string2boolean(String s, boolean defaultValue)
public static StringSupplier stringSupplierAsObject(Supplier<String> supplier)
public static String completableFuture2String(CompletableFuture<?> future, boolean includeDetails)
Copyright © 2017–2023 The Apache Software Foundation. All rights reserved.