Package io.github.mmm.validation.main
Class AbstractValidatorRange<V,R>
- 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:
ValidatorCharSequnceSize
,ValidatorCollectionSize
,ValidatorMapSize
,ValidatorPatternSize
,ValidatorRange
public class AbstractValidatorRange<V,R> extends AbstractValueValidator<V>
- Since:
- 1.0.0
-
-
Constructor Summary
Constructors Constructor Description AbstractValidatorRange(io.github.mmm.base.range.Range<R> range)
The constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected R
convertValue(V value)
Converts the value to the type of the range.boolean
equals(Object obj)
String
getId()
io.github.mmm.base.range.Range<R>
getRange()
int
hashCode()
protected boolean
isLength()
protected io.github.mmm.nls.NlsMessage
validateNotNull(V value)
-
Methods inherited from class io.github.mmm.validation.AbstractValueValidator
validate, validateNull
-
Methods inherited from class io.github.mmm.validation.AbstractValidator
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
getChild, getChildCount, iterator
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface io.github.mmm.validation.Validator
append, append, containsId, getMax, getMin, isMandatory, validate
-
-
-
-
Field Detail
-
ID
public static final String ID
- See Also:
getId()
, Constant Field Values
-
range
protected final io.github.mmm.base.range.Range<R> range
- See Also:
getRange()
-
-
Constructor Detail
-
AbstractValidatorRange
public AbstractValidatorRange(io.github.mmm.base.range.Range<R> range)
The constructor.- Parameters:
range
- is theRange
the value has to becontained in
.
-
-
Method Detail
-
getId
public String getId()
-
getRange
public io.github.mmm.base.range.Range<R> getRange()
- Returns:
- the
Range
to validate.
-
convertValue
protected R convertValue(V value)
Converts the value to the type of the range.- Parameters:
value
- is the value to convert.- Returns:
- the converted value.
-
validateNotNull
protected io.github.mmm.nls.NlsMessage validateNotNull(V value)
- Specified by:
validateNotNull
in classAbstractValueValidator<V>
-
isLength
protected boolean isLength()
- Returns:
true
if validating the lenght of the value,false
otherwise.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classAbstractValidator<V>
-
equals
public boolean equals(Object obj)
- Overrides:
equals
in classAbstractValidator<V>
-
-