Package de.murmelmeister.murmelapi.utils
Klasse StringUtil
java.lang.Object
de.murmelmeister.murmelapi.utils.StringUtil
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic <T> TcheckArgumentSQL(T value) Check if the value is valid for a SQL query.static booleanstartsWithIgnoreCase(String str, String prefix) Check if the string starts with the given prefix ignoring the case.
-
Konstruktordetails
-
StringUtil
public StringUtil()
-
-
Methodendetails
-
startsWithIgnoreCase
Check if the string starts with the given prefix ignoring the case. If the string is null or shorter than the prefix, the method will return false. Otherwise, the method will return true if the string starts with the prefix ignoring the case.- Parameter:
str- String to checkprefix- Prefix to check- Gibt zurück:
- True if the string starts with the prefix ignoring the case, otherwise false
-
checkArgumentSQL
public static <T> T checkArgumentSQL(T value) Check if the value is valid for a SQL query. The value must only contain letters, numbers, and the following characters: - . ? ! If the value is not valid, an IllegalArgumentException will be thrown.- Typparameter:
T- Type of the value- Parameter:
value- Value to check- Gibt zurück:
- The value if it is valid
- Löst aus:
IllegalArgumentException- If the value is not valid
-