java.lang.Object
io.github.miniplaceholders.api.utils.Conditions
Checks required for the correct operation of the expansions
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
nonEmptyString
(@NotNull String string, @NotNull String reason) Check if a string is empty or consists of whitespace characters only.static String
nonEmptyString
(@NotNull String string, @NotNull Supplier<@NotNull String> reason) Check if a string is empty or consists of whitespace characters only.static String
nonNullOrEmptyString
(@Nullable String string, @NotNull String name) Checks if a string is null or empty or consists of whitespace characters only.static String
nonNullOrEmptyString
(@Nullable String string, @NotNull Supplier<@NotNull String> name) Checks if a string is null or empty or consists of whitespace characters only.
-
Method Details
-
nonNullOrEmptyString
public static String nonNullOrEmptyString(@Nullable @Nullable String string, @NotNull @NotNull Supplier<@NotNull String> name) 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
public static String nonNullOrEmptyString(@Nullable @Nullable String string, @NotNull @NotNull String name) 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
public static String nonEmptyString(@NotNull @NotNull String string, @NotNull @NotNull Supplier<@NotNull String> reason) 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
public static String nonEmptyString(@NotNull @NotNull String string, @NotNull @NotNull String reason) 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
-