Package com.codesseur.validation
Class Verifier<V,S>
- java.lang.Object
-
- com.codesseur.validation.Verifier<V,S>
-
- Direct Known Subclasses:
AbstractCollectionVerifier,AbstractComparableVerifier,AbstractContainerVerifier,BooleanVerifier,DictionaryVerifier,MapVerifier,ObjectVerifier,OptionalVerifier,StringVerifier
public abstract class Verifier<V,S> extends Object
-
-
Constructor Summary
Constructors Constructor Description Verifier()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Conditions<V>conditions()<SS extends Verifier<V,SS>>
SSflatMap(Function<? super io.vavr.Lazy<? extends V>,? extends SS> as)Vget()SisEqualTo(V value)SisIn(Iterable<? extends V> values)SisIn(V... values)SisNotEqualTo(V value)SisNotNull()SisNull()<O> ObjectVerifier<O>map(Function<? super V,? extends O> mapper)<VV,SS extends Verifier<VV,SS>>
SSmap(Function<? super V,? extends VV> mapper, Function<? super io.vavr.Lazy<? extends VV>,SS> as)Smatches(Predicate<? super V> condition)SnotIn(Iterable<? extends V> values)SnotIn(V... values)Sotherwise(String code)Sotherwise(BiFunction<? super V,? super Failure,Failure> failureMapper)Sotherwise(Function<? super V,String> code)SotherwiseThrow()SotherwiseThrow(Function<? super Failures,? extends RuntimeException> otherwise)SotherwiseThrow(Supplier<? extends RuntimeException> otherwise)SotherwiseThrowLast(Function<Failure,? extends RuntimeException> otherwise)Ssatisfies(Function<? super V,io.vavr.control.Either<Failure,Success>> condition)Ssatisfies(Predicate<? super V> condition, Supplier<Failure> failure)Sthen()Sviolates(Predicate<? super V> condition, Supplier<Failure> failure)
-
-
-
Method Detail
-
conditions
@Default public Conditions<V> conditions()
-
get
public V get()
-
isNull
public S isNull()
-
isNotNull
public S isNotNull()
-
isIn
@SafeVarargs public final S isIn(V... values)
-
notIn
@SafeVarargs public final S notIn(V... values)
-
satisfies
public S satisfies(Function<? super V,io.vavr.control.Either<Failure,Success>> condition)
-
otherwise
public S otherwise(BiFunction<? super V,? super Failure,Failure> failureMapper)
-
otherwiseThrowLast
public S otherwiseThrowLast(Function<Failure,? extends RuntimeException> otherwise)
-
otherwiseThrow
public S otherwiseThrow()
-
otherwiseThrow
public S otherwiseThrow(Supplier<? extends RuntimeException> otherwise)
-
otherwiseThrow
public S otherwiseThrow(Function<? super Failures,? extends RuntimeException> otherwise)
-
flatMap
public <SS extends Verifier<V,SS>> SS flatMap(Function<? super io.vavr.Lazy<? extends V>,? extends SS> as)
-
then
public S then()
-
map
public <O> ObjectVerifier<O> map(Function<? super V,? extends O> mapper)
-
-