Package com.codesseur.validation
Class Verifier<V,S extends 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 Verifier<V,S>> extends Object
-
-
Constructor Summary
Constructors Constructor Description Verifier()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <SS extends Verifier<V,SS>>
SSas(Function<? super Conditions<V>,? extends SS> as)io.vavr.control.Either<Failures,V>get()SisEqualTo(V value)SisIn(Iterable<? extends V> values)SisIn(V... values)<T> ObjectVerifier<T>isInstanceOf(com.codesseur.reflect.Type<T> type)<T,SS extends Verifier<T,SS>>
SSisInstanceOf(com.codesseur.reflect.Type<T> type, Function<? super Conditions<T>,? extends SS> as)SisNotEqualTo(V value)SisNotNull()SisNull()<O> ObjectVerifier<O>map(Function<? super V,? extends O> mapper)<VV,SS extends Verifier<VV,SS>>
SSmapAs(Function<? super V,? extends VV> mapper, Function<? super Conditions<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<Failures,V>> condition)Ssatisfies(Predicate<? super V> condition, Supplier<Failures> failure)Sthen()Sverify(Function<? super V,Verifier<?,?>> condition)Sviolates(Predicate<? super V> condition, Supplier<Failures> failure)
-
-
-
Method Detail
-
isInstanceOf
public <T,SS extends Verifier<T,SS>> SS isInstanceOf(com.codesseur.reflect.Type<T> type, Function<? super Conditions<T>,? extends SS> as)
-
isInstanceOf
public <T> ObjectVerifier<T> isInstanceOf(com.codesseur.reflect.Type<T> type)
-
isNull
public S isNull()
-
isNotNull
public S isNotNull()
-
isIn
@SafeVarargs public final S isIn(V... values)
-
notIn
@SafeVarargs public final S notIn(V... values)
-
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)
-
as
public <SS extends Verifier<V,SS>> SS as(Function<? super Conditions<V>,? extends SS> as)
-
then
public S then()
-
map
public <O> ObjectVerifier<O> map(Function<? super V,? extends O> mapper)
-
mapAs
public <VV,SS extends Verifier<VV,SS>> SS mapAs(Function<? super V,? extends VV> mapper, Function<? super Conditions<VV>,SS> as)
-
-