Package io.github.mmm.validation.main
Class AbstractValidatorRange<V,R extends Comparable<?>>
java.lang.Object
io.github.mmm.validation.AbstractValidator<V>
io.github.mmm.validation.AbstractValueValidator<V>
io.github.mmm.validation.main.AbstractValidatorRange<V,R>
- Type Parameters:
V- the generic type of the value tovalidate.R- the generic type of theRange-bounds.
- All Implemented Interfaces:
io.github.mmm.base.lang.Composable<Validator<?>>,Validator<V>,Iterable<Validator<?>>
- Direct Known Subclasses:
AbstractValidatorSize,ValidatorRange
public abstract class AbstractValidatorRange<V,R extends Comparable<?>>
extends AbstractValueValidator<V>
- Since:
- 1.0.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringprotected final io.github.mmm.base.range.Range<R> Fields inherited from interface io.github.mmm.validation.Validator
ID_MANDATORY -
Constructor Summary
ConstructorsConstructorDescriptionAbstractValidatorRange(io.github.mmm.base.range.Range<R> range) The constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected RconvertValue(V value) Converts the value to the type of the range.booleangetId()getMax()getMin()io.github.mmm.base.range.Range<R> getRange()inthashCode()protected abstract booleanisLength()protected NlsMessagevalidateNotNull(V value) Methods inherited from class io.github.mmm.validation.AbstractValueValidator
validate, validateNullMethods inherited from class io.github.mmm.validation.AbstractValidator
getChild, getChildCount, 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, spliteratorMethods inherited from interface io.github.mmm.validation.Validator
append, append, containsId, getChild, isMandatory, validate
-
Field Details
-
ID
- See Also:
-
range
- See Also:
-
-
Constructor Details
-
AbstractValidatorRange
The constructor.- Parameters:
range- is theRangethe value has to becontained in.
-
-
Method Details
-
getId
-
getRange
- Returns:
- the
Rangeto validate.
-
getMin
-
getMax
-
convertValue
Converts the value to the type of the range.- Parameters:
value- is the value to convert.- Returns:
- the converted value.
-
validateNotNull
- Specified by:
validateNotNullin classAbstractValueValidator<V>
-
isLength
protected abstract boolean isLength()- Returns:
trueif validating the length or size of the value,falseotherwise.
-
hashCode
public int hashCode()- Overrides:
hashCodein classAbstractValidator<V>
-
equals
- Overrides:
equalsin classAbstractValidator<V>
-