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
Allows producing error messages.
-
Constructor Summary
ConstructorDescriptionArgumentCheck
(ArgumentUtils.Check check) ArgumentCheck
(String name, T value) -
Method Summary
Modifier and TypeMethodDescriptionvoid
notNull()
Fail the argument with the given message.void
orElseFail
(String message) Fail the argument with the given message.
-
Constructor Details
-
ArgumentCheck
- Parameters:
check
- The check
-
ArgumentCheck
- Parameters:
name
- The namevalue
- The value
-
-
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
-