Package io.github.suppierk.codegen.util
Class Strings
java.lang.Object
io.github.suppierk.codegen.util.Strings
String-related utilities used across the DSL and task registration logic.-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic StringcapitalizeFirstLetter(String value) Returns capitalized stringstatic StringfirstNonBlank(String value, String... values) Returns first non-null, non-blankString.
-
Field Details
-
EMPTY
Just en empty string.- See Also:
-
-
Method Details
-
firstNonBlank
@Nonnull public static String firstNonBlank(@Nullable String value, @Nullable String... values) throws IllegalArgumentException Returns first non-null, non-blankString.- Parameters:
value- as a workaround to enforce at least one argumentvalues- is a variableStringvalues to pick from- Returns:
- first non-null, non-blank
String. - Throws:
IllegalArgumentException- if all available values are null or blank
-
capitalizeFirstLetter
@Nonnull public static String capitalizeFirstLetter(@Nullable String value) throws IllegalArgumentException Returns capitalized string- Parameters:
value- to capitalize- Returns:
- initial
Stringwith a capitalized first letter, e.g. 'value' turns into 'Value' or emptyStringif the input was null or blank - Throws:
IllegalArgumentException
-