Package io.micronaut.core.util
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 java.lang.ObjectAllows producing error messages.
-
-
Constructor Summary
Constructors Constructor Description ArgumentCheck(ArgumentUtils.Check check)ArgumentCheck(java.lang.String name, T value)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidnotNull()Fail the argument with the given message.voidorElseFail(java.lang.String message)Fail the argument with the given message.
-
-
-
Constructor Detail
-
ArgumentCheck
public ArgumentCheck(ArgumentUtils.Check check)
- Parameters:
check- The check
-
ArgumentCheck
public ArgumentCheck(java.lang.String name, T value)- Parameters:
name- The namevalue- The value
-
-
Method Detail
-
orElseFail
public void orElseFail(java.lang.String message)
Fail the argument with the given message.- Parameters:
message- The message- Throws:
java.lang.IllegalArgumentException- Thrown with the given message if the check fails
-
notNull
public void notNull()
Fail the argument with the given message.- Throws:
java.lang.NullPointerException- Thrown with the given message if the check fails
-
-