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> boolean
containsId
(String id) boolean
getChild
(int index) <T> T
int
<T extends Comparable<?>>
Range<T> getRange()
int
hashCode()
protected ValidationResult
validateChild
(C value, String valueSource) protected void
validateChild
(C value, String valueSource, ValidationResultBuilder builder) Methods inherited from class io.github.mmm.validation.AbstractValidator
getId, isDynamic, source2string, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.github.mmm.base.lang.Composable
iterator
Methods 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:
getChildCount
in interfaceComposable<V>
- Overrides:
getChildCount
in classAbstractValidator<V>
-
getChild
- Specified by:
getChild
in interfaceComposable<V>
- Overrides:
getChild
in classAbstractValidator<V>
-
append
-
append
-
containsId
-
getChild
-
getRange
- Type Parameters:
T
- type of theRange
value. Typically of type <V> but e.g. forString
orCollection
the type would beInteger
to validate the size of the actual value.- Returns:
- the
Range
constraint with an optionalmimimum
and/ormaximum
value. Will beRange.unbounded()
by if no bounds are validated.
-
hashCode
public int hashCode()- Overrides:
hashCode
in classAbstractValidator<V>
-
equals
- Overrides:
equals
in classAbstractValidator<V>
-