Class ArgumentUtils.ArgumentCheck<T>
java.lang.Object
io.micronaut.core.util.ArgumentUtils.ArgumentCheck<T>
- Type Parameters:
T- The type
- Enclosing class:
ArgumentUtils
Allows producing error messages.
- Since:
- 1.0
- Author:
- Graeme Rocher
-
Constructor Summary
ConstructorsConstructorDescriptionArgumentCheck(ArgumentUtils.Check check) ArgumentCheck(String name, @Nullable T value) -
Method Summary
Modifier and TypeMethodDescriptionvoidnotNull()Fail the argument with the given message.voidorElseFail(String message) Fail the argument with the given message.
-
Constructor Details
-
ArgumentCheck
- Parameters:
check- The check
-
ArgumentCheck
-
-
Method Details
-
orElseFail
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
-