Class FieldValidationRule<R,T>
- java.lang.Object
-
- be.sddevelopment.commons.validation.FieldValidationRule<R,T>
-
- All Implemented Interfaces:
Rule<R>
public class FieldValidationRule<R,T> extends Object implements Rule<R>
ValidationRule to be used to check validity of an object's field
- Version:
- 1.0.0
- Author:
- Stijn Dejongh
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FieldValidationRule.FieldValidationRuleBuilder<R,T>
-
Constructor Summary
Constructors Constructor Description FieldValidationRule(Function<R,T> extractor, Function<T,Boolean> fieldAssertion, FailureBuilderClause<T> failureCreator)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description FieldValidationRule<R,T>
andTo(Function<T,Boolean> toAssert)
static <R,T>
FieldValidationRule.FieldValidationRuleBuilder<R,T>builder()
FieldValidationRule<R,T>
compliesTo(Function<T,Boolean> toAssert)
static <R> FieldValidationRule<R,R>
data()
FieldValidationRule<R,T>
elseFail(FailureBuilderClause<T> failureDelta)
static <R,T>
FieldValidationRule<R,T>field(Function<R,T> fieldExtractor)
Function<R,Boolean>
getAssertion()
Function<R,Function<Failure.FailureBuilder,Failure.FailureBuilder>>
getFailureCreator()
FieldValidationRule.FieldValidationRuleBuilder<R,T>
toBuilder()
-
-
-
Method Detail
-
field
public static <R,T> FieldValidationRule<R,T> field(Function<R,T> fieldExtractor)
-
data
public static <R> FieldValidationRule<R,R> data()
-
elseFail
public FieldValidationRule<R,T> elseFail(FailureBuilderClause<T> failureDelta)
-
getAssertion
public Function<R,Boolean> getAssertion()
- Specified by:
getAssertion
in interfaceRule<R>
-
getFailureCreator
public Function<R,Function<Failure.FailureBuilder,Failure.FailureBuilder>> getFailureCreator()
- Specified by:
getFailureCreator
in interfaceRule<R>
-
builder
public static <R,T> FieldValidationRule.FieldValidationRuleBuilder<R,T> builder()
-
toBuilder
public FieldValidationRule.FieldValidationRuleBuilder<R,T> toBuilder()
-
-