Package io.github.mmm.validation.main
Class ValidatorCompare<V extends Comparable<V>>
java.lang.Object
io.github.mmm.validation.AbstractValidator<V>
io.github.mmm.validation.AbstractValueValidator<V>
io.github.mmm.validation.main.ValidatorCompare<V>
- Type Parameters:
V- is the generic type of the value tovalidate.
- All Implemented Interfaces:
io.github.mmm.base.lang.Composable<Validator<?>>,Validator<V>,Iterable<Validator<?>>
Validator validating that a value
satisfies a given CompareOperator -operation for given
value to compare to.- Since:
- 1.0.0
-
Field Summary
Fields inherited from interface io.github.mmm.validation.Validator
ID_MANDATORY -
Constructor Summary
ConstructorsConstructorDescriptionValidatorCompare(io.github.mmm.base.compare.CompareOperator comparator, Supplier<V> valueSource) The constructor.ValidatorCompare(io.github.mmm.base.compare.CompareOperator comparator, V value) The constructor. -
Method Summary
Modifier and TypeMethodDescriptionbooleaninthashCode()booleanprotected NlsMessagevalidateNotNull(V value) Methods inherited from class io.github.mmm.validation.AbstractValueValidator
validate, validateNullMethods inherited from class io.github.mmm.validation.AbstractValidator
getChild, getChildCount, getId, 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, getMax, getMin, getRange, isMandatory, validate
-
Constructor Details
-
ValidatorCompare
public ValidatorCompare(io.github.mmm.base.compare.CompareOperator comparator, Supplier<V> valueSource) The constructor.- Parameters:
comparator- is thecomparison operatorused to compare thevalue to validate(first argument) with the value of the givenvalueSource.valueSource- is a reference to something thatprovides a valueand will be evaluateddynamicallyon everyvalidation.
-
ValidatorCompare
The constructor.- Parameters:
comparator- is thecomparison operatorused to compare thevalue to validate(first argument) with the value of the givenvalue.value- is the fixed value to compare to.
-
-
Method Details
-
isDynamic
public boolean isDynamic()- Overrides:
isDynamicin classAbstractValidator<V extends Comparable<V>>
-
validateNotNull
- Specified by:
validateNotNullin classAbstractValueValidator<V extends Comparable<V>>
-
hashCode
public int hashCode()- Overrides:
hashCodein classAbstractValidator<V extends Comparable<V>>
-
equals
- Overrides:
equalsin classAbstractValidator<V extends Comparable<V>>
-