Package com.github.tonivade.purefun.core
Interface Precondition
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
-
Method Summary
Modifier and TypeMethodDescriptiondefault Preconditionand(Precondition other) booleanapply()static voidcheck(Precondition precondition) static voidcheck(Precondition precondition, Producer<String> message) static voidcheck(Precondition precondition, String message) static intcheckNegative(int value) static intcheckNegative(int value, String message) static StringcheckNonEmpty(String value) static StringcheckNonEmpty(String value, String message) static <T> TcheckNonNull(T value) static <T> TcheckNonNull(T value, String message) static intcheckPositive(int value) static intcheckPositive(int value, String message) static intcheckRange(int value, int min, int max) static intcheckRange(int value, int min, int max, String message) static Preconditionstatic PreconditiongreaterThan(int value, int min) static PreconditiongreaterThanOrEquals(int value, int min) static PreconditionlowerThan(int value, int max) static PreconditionlowerThanOrEquals(int value, int max) default Preconditionnegate()static Preconditionnegative(int value) static Preconditionstatic Preconditionstatic Preconditionpositive(int value) static Preconditionrange(int value, int min, int max) static <X extends RuntimeException>
voidrequire(Precondition precondition, Producer<? extends X> exception)
-
Method Details
-
apply
boolean apply() -
negate
-
and
-
nonNull
-
empty
-
nonEmpty
-
positive
-
negative
-
greaterThan
-
greaterThanOrEquals
-
lowerThan
-
lowerThanOrEquals
-
range
-
checkNonNull
static <T> T checkNonNull(T value) -
checkNonNull
-
checkNonEmpty
-
checkNonEmpty
-
checkPositive
static int checkPositive(int value) -
checkPositive
-
checkNegative
static int checkNegative(int value) -
checkNegative
-
checkRange
static int checkRange(int value, int min, int max) -
checkRange
-
check
-
check
-
check
-
require
static <X extends RuntimeException> void require(Precondition precondition, Producer<? extends X> exception)
-