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 String
protected 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 R
convertValue
(V value) Converts the value to the type of the range.boolean
getId()
getMax()
getMin()
io.github.mmm.base.range.Range
<R> getRange()
int
hashCode()
protected abstract boolean
isLength()
protected NlsMessage
validateNotNull
(V value) Methods inherited from class io.github.mmm.validation.AbstractValueValidator
validate, validateNull
Methods inherited from class io.github.mmm.validation.AbstractValidator
getChild, getChildCount, 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
append, append, containsId, getChild, isMandatory, validate
-
Field Details
-
ID
- See Also:
-
range
- See Also:
-
-
Constructor Details
-
AbstractValidatorRange
The constructor.- Parameters:
range
- is theRange
the value has to becontained in
.
-
-
Method Details
-
getId
-
getRange
- Returns:
- the
Range
to 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:
validateNotNull
in classAbstractValueValidator<V>
-
isLength
protected abstract boolean isLength()- Returns:
true
if validating the length or size of the value,false
otherwise.
-
hashCode
public int hashCode()- Overrides:
hashCode
in classAbstractValidator<V>
-
equals
- Overrides:
equals
in classAbstractValidator<V>
-