Package de.murmelmeister.murmelapi.utils
Class StringUtil
java.lang.Object
de.murmelmeister.murmelapi.utils.StringUtil
Utility class for string operations.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Object[]checkAllObjects(Object[] objects) Checks all objects in the given array and returns a concatenated string representation of the checked objects.static <T> TcheckArgumentSQL(T value) Checks if the given value is a valid SQL argument.static booleanstartsWithIgnoreCase(String str, String prefix)
-
Field Details
-
VALID_SQL_PATTERN
-
-
Constructor Details
-
StringUtil
public StringUtil()
-
-
Method Details
-
startsWithIgnoreCase
-
checkArgumentSQL
public static <T> T checkArgumentSQL(T value) Checks if the given value is a valid SQL argument.- Parameters:
value- the value to check- Returns:
- the same value passed as the parameter if it is valid
- Throws:
IllegalArgumentException- if the value contains invalid characters. Only alphanumerics and -_.?!*invalid input: '<'>:/ are allowed.
-
checkAllObjects
Checks all objects in the given array and returns a concatenated string representation of the checked objects.- Parameters:
objects- the array of objects to check- Returns:
- a string representation of the checked objects, separated by commas. Returns an empty string if the array is empty.
- Throws:
IllegalArgumentException- if any of the objects contains invalid characters. Only alphanumerics and -_.?!*invalid input: '<'>:/ are allowed.
-