Package com.kamikazejam.kamicommon.util
Class TextUtil
java.lang.Object
com.kamikazejam.kamicommon.util.TextUtil
Utility methods for working with text strings.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Stringcapitalize(@Nullable String str) Capitalizes the first character of the given string.
If the input is null or empty, the original value is returned unchanged.static @NotNull StringIntegerToRomanNumeral(int input) Converts an integer to a Roman Numeral
Supports ONLY integers in the range [1, 3999] (inclusive)
-
Constructor Details
-
TextUtil
public TextUtil()
-
-
Method Details
-
capitalize
@Contract(value="null -> null; !null -> !null", pure=true) public static String capitalize(@Nullable @Nullable String str) Capitalizes the first character of the given string.
If the input is null or empty, the original value is returned unchanged.- Parameters:
str- the input string, may be null- Returns:
- the input string with its first character uppercased, or the original value if null or empty
-
IntegerToRomanNumeral
@NotNull public static @NotNull String IntegerToRomanNumeral(int input) throws IllegalArgumentException Converts an integer to a Roman Numeral
Supports ONLY integers in the range [1, 3999] (inclusive)- Returns:
- The Roman Numeral representation of the input integer
- Throws:
IllegalArgumentException- if the input is not in the range [1, 3999]
-