Class Validator<T>
- java.lang.Object
-
- io.streamthoughts.azkarra.api.monad.Validator<T>
-
public class Validator<T> extends Object
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description T
get()
T
getOrThrow(Function<List<Error>,Throwable> f)
boolean
isValid()
static <T> Validator<T>
of(T value)
Either<T,List<Error>>
toEither()
Optional<T>
toOptional()
Validator<T>
validates(Predicate<? super T> predicate, Error error)
Validator<T>
validates(Predicate<? super T> predicate, String error)
-
-
-
Method Detail
-
of
public static <T> Validator<T> of(T value)
-
get
public T get() throws IllegalStateException
- Throws:
IllegalStateException
-
isValid
public boolean isValid()
-
-