Class Conditions
java.lang.Object
io.github.miniplaceholders.api.utils.Conditions
Checks required for the correct operation of the expansions
- Since:
- 1.0.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringnonEmptyString(String string, String reason) Check if a string is empty or consists of whitespace characters only.static StringnonEmptyString(String string, Supplier<String> reason) Check if a string is empty or consists of whitespace characters only.static StringnonNullOrEmptyString(@Nullable String string, String name) Checks if a string is null or empty or consists of whitespace characters only.static StringnonNullOrEmptyString(@Nullable String string, Supplier<String> name) Checks if a string is null or empty or consists of whitespace characters only.
-
Method Details
-
nonNullOrEmptyString
Checks if a string is null or empty or consists of whitespace characters only.- Parameters:
string- the stringname- the name supplier- Returns:
- the string if it is not null or empty
- Throws:
IllegalStateException- if the provided string is empty- Since:
- 1.0.0
-
nonNullOrEmptyString
Checks if a string is null or empty or consists of whitespace characters only.- Parameters:
string- the stringname- the name- Returns:
- the string if it is not null or empty
- Throws:
IllegalStateException- if the provided string is empty- Since:
- 2.2.0
-
nonEmptyString
Check if a string is empty or consists of whitespace characters only.- Parameters:
string- the stringreason- the reason supplier- Returns:
- the string if it not empty
- Throws:
IllegalStateException- if the provided string is empty- Since:
- 1.0.0
-
nonEmptyString
Check if a string is empty or consists of whitespace characters only.- Parameters:
string- the stringreason- the reason- Returns:
- the string if it not empty
- Throws:
IllegalStateException- if the provided string is empty- Since:
- 2.2.0
-