public class Utils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
EOL |
static Predicate<String> |
STRING_NOT_EMPTY |
Constructor and Description |
---|
Utils() |
Modifier and Type | Method and Description |
---|---|
static <T> List<T> |
arrayToList(T[] array)
Deprecated.
This is no longer in use by JavaParser, please write your own replacement.
|
static String |
assertNonEmpty(String string) |
static <T> T |
assertNotNull(T o) |
static String |
camelCaseToScreaming(String input) |
static String |
capitalize(String s)
Capitalizes the first character in the string.
|
static String |
decapitalize(String s)
Lower-cases the first character in the string.
|
static <T> List<T> |
ensureNotNull(List<T> list)
Deprecated.
This is no longer in use by JavaParser, please write your own replacement.
|
static String |
escapeEndOfLines(String string) |
static StringBuilder |
indent(StringBuilder builder,
int indentLevel)
Make an indent by appending indentLevel tab characters to the builder.
|
static <E> boolean |
isNullOrEmpty(Collection<E> collection) |
static String |
nextWord(String string)
Return the next word of the string, in other words it stops when a space is encountered.
|
static String |
readerToString(Reader reader) |
static String |
screamingToCamelCase(String original)
Transform a string to the camel case conversion.
|
static String |
toCamelCase(String original)
Deprecated.
use screamingToCamelCase
|
static boolean |
valueIsNullOrEmpty(Object value)
Return true if the value is null, an empty Optional, or an empty String.
|
public static final String EOL
public static <T> List<T> ensureNotNull(List<T> list)
public static <E> boolean isNullOrEmpty(Collection<E> collection)
public static <T> T assertNotNull(T o)
public static String escapeEndOfLines(String string)
public static String readerToString(Reader reader) throws IOException
IOException
public static <T> List<T> arrayToList(T[] array)
public static String screamingToCamelCase(String original)
For example "ABC_DEF" becomes "abcDef"
public static String camelCaseToScreaming(String input)
input
- "aCamelCaseString"public static String nextWord(String string)
public static StringBuilder indent(StringBuilder builder, int indentLevel)
public static String decapitalize(String s)
public static boolean valueIsNullOrEmpty(Object value)
value
- Copyright © 2007–2017. All rights reserved.