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 Tget()TgetOrThrow(Function<List<Error>,Throwable> f)booleanisValid()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()
-
-