java.lang.Object
io.github.miniplaceholders.api.utils.Conditions

public final class Conditions extends Object
Checks required for the correct operation of the expansions
  • 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 string
      name - 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 string
      name - 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 string
      reason - 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 string
      reason - the reason
      Returns:
      the string if it not empty
      Throws:
      IllegalStateException - if the provided string is empty
      Since:
      2.2.0