Class ValidatorCollectionElements<E>
- java.lang.Object
-
- io.github.mmm.validation.AbstractValidator<V>
-
- io.github.mmm.validation.AbstractComposedValidator<Collection<E>,E>
-
- io.github.mmm.validation.collection.ValidatorCollectionElements<E>
-
- Type Parameters:
E
- the generic type of theelements contained
in the collection.
- All Implemented Interfaces:
Composable<Validator<?>>
,Validator<Collection<E>>
,Iterable<Validator<?>>
public class ValidatorCollectionElements<E> extends AbstractComposedValidator<Collection<E>,E>
- Since:
- 1.0.0
-
-
Field Summary
-
Fields inherited from class io.github.mmm.validation.AbstractComposedValidator
children
-
Fields inherited from interface io.github.mmm.validation.Validator
ID_MANDATORY
-
-
Constructor Summary
Constructors Constructor Description ValidatorCollectionElements(Validator<? super E>... validators)
The constructor.ValidatorCollectionElements(List<AbstractValidator<? super E>> validators)
The constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ValidationResult
validate(Collection<E> collection, Object valueSource)
This method validates the givenvalue
.-
Methods inherited from class io.github.mmm.validation.AbstractComposedValidator
append, append, containsId, equals, getChild, getChildCount, hashCode, validateChild, validateChild
-
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
-
Methods inherited from interface io.github.mmm.validation.Validator
getMax, getMin, isMandatory, validate
-
-
-
-
Constructor Detail
-
ValidatorCollectionElements
@SafeVarargs public ValidatorCollectionElements(Validator<? super E>... validators)
The constructor.- Parameters:
validators
- theAbstractValidator
s used tovalidate
each element.
-
ValidatorCollectionElements
public ValidatorCollectionElements(List<AbstractValidator<? super E>> validators)
The constructor.- Parameters:
validators
- theAbstractValidator
s used tovalidate
each element.
-
-
Method Detail
-
validate
public ValidationResult validate(Collection<E> collection, Object valueSource)
Description copied from interface:Validator
This method validates the givenvalue
.- Parameters:
collection
- is the value to validate.valueSource
- is thesource
describing the origin of the givenvalue
. The source needs to have a reasonablestring-representation
as this may be displayed to the end-user to locate the source of the failure. In most cases it is suitable to directly pass aString
.- Returns:
- the
ValidationResult
.
-
-