- java.lang.Object
-
- io.github.mmm.validation.AbstractValidator<V>
-
- io.github.mmm.validation.AbstractValueValidator<Object>
-
- io.github.mmm.validation.main.ValidatorMandatory
-
- All Implemented Interfaces:
io.github.mmm.base.lang.Composable<Validator<?>>
,Validator<Object>
,Iterable<Validator<?>>
public class ValidatorMandatory extends AbstractValueValidator<Object>
Validator
validating that a mandatory value is filled.ValidationResult
will be invalid if the value is not provided (empty, blank,null
).- Since:
- 1.0.0
-
-
Field Summary
Fields Modifier and Type Field Description static String
ID
-
Fields inherited from interface io.github.mmm.validation.Validator
ID_MANDATORY
-
-
Constructor Summary
Constructors Constructor Description ValidatorMandatory()
The constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ValidatorMandatory
get()
String
getId()
boolean
isMandatory()
protected io.github.mmm.nls.NlsMessage
validateNotNull(Object value)
protected io.github.mmm.nls.NlsMessage
validateNull()
-
Methods inherited from class io.github.mmm.validation.AbstractValueValidator
validate
-
Methods inherited from class io.github.mmm.validation.AbstractValidator
equals, hashCode, 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
-
-
-
-
Field Detail
-
ID
public static final String ID
- See Also:
getId()
, Constant Field Values
-
-
Method Detail
-
getId
public String getId()
-
get
public static ValidatorMandatory get()
- Returns:
- the singleton instance of this class.
-
validateNull
protected io.github.mmm.nls.NlsMessage validateNull()
- Overrides:
validateNull
in classAbstractValueValidator<Object>
-
validateNotNull
protected io.github.mmm.nls.NlsMessage validateNotNull(Object value)
- Specified by:
validateNotNull
in classAbstractValueValidator<Object>
-
isMandatory
public final boolean isMandatory()
-
-