Module io.github.mmm.validation
Package io.github.mmm.validation
Class AbstractComposedValidator<V,C>
java.lang.Object
io.github.mmm.validation.AbstractValidator<V>
io.github.mmm.validation.AbstractComposedValidator<V,C>
- Type Parameters:
V- type of the value tovalidate.C- type of the child value to validate using thechild validators.
- All Implemented Interfaces:
Composable<Validator<?>>,Validator<V>,Iterable<Validator<?>>
- Direct Known Subclasses:
ComposedValidator,ProjectionValidator
Validator that is composed out of a set of individual validators given at
construction. It will always invoke all
contained validators when a validation is performed.- Since:
- 1.0.0
-
Field Summary
FieldsFields inherited from interface io.github.mmm.validation.Validator
ID_MANDATORY -
Constructor Summary
ConstructorsConstructorDescriptionAbstractComposedValidator(Validator<? super C>... validators) The constructor. -
Method Summary
Modifier and TypeMethodDescription<T> Validator<T> <T> Validator<T> booleancontainsId(String id) booleangetChild(int index) <T> Tint<T extends Comparable<?>>
Range<T> getRange()inthashCode()protected ValidationResultvalidateChild(C value, String valueSource) protected voidvalidateChild(C value, String valueSource, ValidationResultBuilder builder) Methods inherited from class io.github.mmm.validation.AbstractValidator
getId, isDynamic, source2string, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.github.mmm.base.lang.Composable
iteratorMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
children
-
-
Constructor Details
-
Method Details
-
validateChild
- Parameters:
value- is the value to validate.valueSource- is thesource.- Returns:
- the
ValidationResult. - See Also:
-
validateChild
- Parameters:
value- is the value to validate.valueSource- is thesource.builder- theValidationResultBuilder.- See Also:
-
getChildCount
public int getChildCount()- Specified by:
getChildCountin interfaceComposable<V>- Overrides:
getChildCountin classAbstractValidator<V>
-
getChild
- Specified by:
getChildin interfaceComposable<V>- Overrides:
getChildin classAbstractValidator<V>
-
append
-
append
-
containsId
-
getChild
-
getRange
- Type Parameters:
T- type of theRangevalue. Typically of type <V> but e.g. forStringorCollectionthe type would beIntegerto validate the size of the actual value.- Returns:
- the
Rangeconstraint with an optionalmimimumand/ormaximumvalue. Will beRange.unbounded()by if no bounds are validated.
-
hashCode
public int hashCode()- Overrides:
hashCodein classAbstractValidator<V>
-
equals
- Overrides:
equalsin classAbstractValidator<V>
-