Class ArgumentUtils.ArgumentCheck<T>

java.lang.Object
io.micronaut.core.util.ArgumentUtils.ArgumentCheck<T>
Type Parameters:
T - The type
Enclosing class:
ArgumentUtils

public static class ArgumentUtils.ArgumentCheck<T> extends Object
Allows producing error messages.
  • Constructor Details

    • ArgumentCheck

      public ArgumentCheck(ArgumentUtils.Check check)
      Parameters:
      check - The check
    • ArgumentCheck

      public ArgumentCheck(String name, T value)
      Parameters:
      name - The name
      value - The value
  • Method Details

    • orElseFail

      public void orElseFail(String message)
      Fail the argument with the given message.
      Parameters:
      message - The message
      Throws:
      IllegalArgumentException - Thrown with the given message if the check fails
    • notNull

      public void notNull()
      Fail the argument with the given message.
      Throws:
      NullPointerException - Thrown with the given message if the check fails