public class ValidatorCollectionSize extends AbstractValidatorRange<Collection<?>,Integer>
ValueValidator
validating
that the
size
of a given Collection
is within a predefined
Range
.CODE
PROPERTY_MANDATORY, PROPERTY_MAXIMUM, PROPERTY_MINIMUM
Constructor and Description |
---|
ValidatorCollectionSize(int maxLength)
The constructor.
|
ValidatorCollectionSize(Range<Integer> range)
The constructor.
|
Modifier and Type | Method and Description |
---|---|
protected Integer |
convertValue(Collection<?> value)
Converts the value to the type of the range.
|
equals, getCode, getProperty, hashCode, validateNotNull
validate, validateNull
append, contains, createBundle, isDynamic, isMandatory, validate
public ValidatorCollectionSize(Range<Integer> range)
range
- is the Range
the value has to be contained in
.public ValidatorCollectionSize(int maxLength)
maxLength
- the maximum
size
allowed for the
Collection
values.protected Integer convertValue(Collection<?> value)
AbstractValidatorRange
convertValue
in class AbstractValidatorRange<Collection<?>,Integer>
value
- is the value to convert.Copyright © 2001–2016 mmm-Team. All rights reserved.