Package com.github.tonivade.purefun.core
Interface Validator<E,T>
- 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 Validator<Validation.Result<E>, T> static <E,T> Validator <Validation.Result<E>, T> static <E,F, T> Validator <F, T> combine(Validator<E, T> v1, Validator<E, T> v2, Function1<Validation.Result<E>, F> reduce) static <E,T> Validator <Validation.Result<E>, T> static <E,F, T> Validator <F, T> combine(Validator<E, T> v1, Validator<E, T> v2, Validator<E, T> v3, Function1<Validation.Result<E>, F> reduce) static <E,T> Validator <Validation.Result<E>, T> static <E,F, T> Validator <F, T> combine(Validator<E, T> v1, Validator<E, T> v2, Validator<E, T> v3, Validator<E, T> v4, Function1<Validation.Result<E>, F> reduce) static <E,T> Validator <Validation.Result<E>, T> combine(Validator<E, T> v1, Validator<E, T> v2, Validator<E, T> v3, Validator<E, T> v4, Validator<E, T> v5) static <E,F, T> Validator <F, T> combine(Validator<E, T> v1, Validator<E, T> v2, Validator<E, T> v3, Validator<E, T> v4, Validator<E, T> v5, Function1<Validation.Result<E>, F> reduce) equalsTo(T expected) static <E,T> Validator <E, T> static <T extends Comparable<T>>
Validator<String, T> greaterThan(T min) static <T extends Comparable<T>>
Validator<String, T> greaterThan(T min, Producer<String> message) static <T extends Comparable<T>>
Validator<String, T> greaterThanOrEqual(T min) static <T extends Comparable<T>>
Validator<String, T> greaterThanOrEqual(T min, Producer<String> message) instanceOf(Class<?> clazz) instanceOf(Class<?> clazz, Producer<String> message) static <E,T> Validator <E, T> invalid(E error) static <E> Function1<Validation.Result<E>, String> join()static <E> Function1<Validation.Result<E>, String> static <E> Function1<Validation.Result<E>, String> static <E> Function1<Validation.Result<E>, String> length(int min, int max) lower()static <T extends Comparable<T>>
Validator<String, T> lowerThan(T max) static <T extends Comparable<T>>
Validator<String, T> static <T extends Comparable<T>>
Validator<String, T> lowerThanOrEqual(T max) static <T extends Comparable<T>>
Validator<String, T> lowerThanOrEqual(T max, Producer<String> message) maxLength(int length) minLength(int length) negative()nonEmpty()static <T extends Comparable<T>>
Validator<String, T> nonEquals(T value) static <T extends Comparable<T>>
Validator<String, T> nonNull()nonNullAnd(Producer<String> message, Validator<String, T> then) nonNullAnd(Validator<String, T> then) notEqualsTo(T expected) notEqualsTo(T expected, Producer<String> message) positive()static <E,A, B> Validator <Validation.Result<E>, Tuple2<A, B>> product(Validator<E, A> v1, Validator<E, B> v2, Function1<Validation.Result<E>, F> reduce) static <E,A, B, C>
Validator<Validation.Result<E>, Tuple3<A, B, C>> product(Validator<E, A> v1, Validator<E, B> v2, Validator<E, C> v3, Function1<Validation.Result<E>, F> reduce) static <E,A, B, C, D>
Validator<Validation.Result<E>, Tuple4<A, B, C, D>> product(Validator<E, A> v1, Validator<E, B> v2, Validator<E, C> v3, Validator<E, D> v4, Function1<Validation.Result<E>, F> reduce) static <F,A, B, C, D, E>
Validator<Validation.Result<F>, Tuple5<A, B, C, D, E>> product(Validator<F, A> v1, Validator<F, B> v2, Validator<F, C> v3, Validator<F, D> v4, Validator<F, E> v5) product(Validator<F, A> v1, Validator<F, B> v2, Validator<F, C> v3, Validator<F, D> v4, Validator<F, E> v5, Function1<Validation.Result<F>, G> reduce) range(int start, int end) startsWith(String prefix) startsWith(String prefix, Producer<String> message) upper()static <E,T> Validator <E, T> valid()Validation<E, T>
-
Method Details
-
validate
-
mapError
-
compose
-
andThen
-
combine
-
from
-
product
static <E,A, Validator<Validation.Result<E>,B> Tuple2<A, productB>> (Validator<E, A> v1, Validator<E, B> v2) -
product
-
product
-
product
-
product
-
product
-
product
-
product
-
combine
-
combine
static <E,F, Validator<F,T> T> combine(Validator<E, T> v1, Validator<E, T> v2, Function1<Validation.Result<E>, F> reduce) -
combine
static <E,T> Validator<Validation.Result<E>,T> combine(Validator<E, T> v1, Validator<E, T> v2, Validator<E, T> v3) -
combine
-
combine
-
combine
-
combine
-
combine
-
valid
-
invalid
-
nonNull
-
nonNull
-
nonNullAnd
-
nonNullAnd
-
equalsTo
-
equalsTo
-
notEqualsTo
-
notEqualsTo
-
instanceOf
-
instanceOf
-
nonEmpty
-
nonEmpty
-
upper
-
upper
-
lower
-
lower
-
startsWith
-
startsWith
-
contains
-
contains
-
endsWith
-
endsWith
-
match
-
match
-
minLength
-
minLength
-
maxLength
-
maxLength
-
nonEquals
-
nonEquals
-
positive
-
positive
-
negative
-
negative
-
greaterThan
-
greaterThan
-
greaterThanOrEqual
-
greaterThanOrEqual
static <T extends Comparable<T>> Validator<String,T> greaterThanOrEqual(T min, Producer<String> message) -
lowerThan
-
lowerThan
-
lowerThanOrEqual
-
lowerThanOrEqual
static <T extends Comparable<T>> Validator<String,T> lowerThanOrEqual(T max, Producer<String> message) -
length
-
length
-
range
-
range
-
join
-
join
-
join
-
join
-