public class StringUtils extends Object
Constructor and Description |
---|
StringUtils() |
Modifier and Type | Method and Description |
---|---|
static Set<String> |
asSet(String... elements) |
static String |
byteToHexString(byte[] bytes,
int start,
int end)
Given an array of bytes it will convert the bytes to a hex string
representation of the bytes.
|
static List<String> |
intern(List<String> list)
Return an interned list with identical contents as the given list.
|
static Map<String,String> |
intern(Map<String,String> map)
Return an interned map with identical contents as the given map.
|
static String |
intern(String str)
Return the internalized string, or null if the given string is null.
|
static boolean |
isEmpty(CharSequence cs)
Checks if the input string/char sequence is empty
|
static String |
normalizeIdentifier(String identifier)
Normalize all identifiers to make equality comparisons easier.
|
static String |
stringifyException(Throwable e)
Make a string representation of the exception.
|
public static String intern(String str)
str
- The string to internpublic static List<String> intern(List<String> list)
list
- The list whose strings will be internedpublic static Map<String,String> intern(Map<String,String> map)
map
- The map whose strings will be internedpublic static String normalizeIdentifier(String identifier)
identifier
- identifierpublic static String stringifyException(Throwable e)
e
- The exception to stringifypublic static String byteToHexString(byte[] bytes, int start, int end)
bytes
- Input bytesstart
- start index, inclusivelyend
- end index, exclusivelypublic static boolean isEmpty(CharSequence cs)
cs
- Input char sequenceCopyright © 2022 The Apache Software Foundation. All rights reserved.