java.lang.Object
io.github.mmm.validation.ValidationResultValid
- All Implemented Interfaces:
Localizable,LocalizableObject,Composable<ValidationResult>,ValidationResult,Iterable<ValidationResult>
ValidationResult that is valid.- Since:
- 1.0.0
-
Field Summary
Fields inherited from interface io.github.mmm.base.i18n.Localizable
BUNDLE_PREFIX -
Method Summary
Modifier and TypeMethodDescriptionadd(ValidationResult result) static ValidationResultValidget()getChild(int index) intgetCode()getLocalizedMessage(Locale locale) voidgetLocalizedMessage(Locale locale, Appendable buffer, boolean verbose) booleanisValid()toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, 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.base.i18n.Localizable
getArgument, toLocalizableMethods inherited from interface io.github.mmm.validation.ValidationResult
containsCode, getLocalizedMessage, getLocalizedMessage, getLocalizedMessage, getMessage
-
Method Details
-
isValid
public boolean isValid()- Specified by:
isValidin interfaceValidationResult- Returns:
trueif the validation was successful,falseotherwise. A successfulValidationResultis always empty. All other methods will not return any resonable result.
-
getChildCount
public int getChildCount()- Specified by:
getChildCountin interfaceComposable<ValidationResult>
-
getChild
- Specified by:
getChildin interfaceComposable<ValidationResult>
-
getSource
- Specified by:
getSourcein interfaceValidationResult- Returns:
- the optional
validation sourcedescribing the origin of thevaluethat has been validated. May benull. If present this may be the filename where the value was read from, an XPath where the value was located in an XML document, the label of a widget of the UI containing the value, etc. This will help to find the problem easier.
-
getMessage
- Specified by:
getMessagein interfaceLocalizable- Specified by:
getMessagein interfaceValidationResult- See Also:
-
getLocalizedMessage
- Specified by:
getLocalizedMessagein interfaceLocalizable
-
getLocalizedMessage
- Specified by:
getLocalizedMessagein interfaceLocalizable
-
getLocalizedMessage
- Specified by:
getLocalizedMessagein interfaceValidationResult- Parameters:
locale- is theLocaleto translate to.buffer- theAppendablewhere towritethe message to.verbose- the verbose flag (to includecode(s), etc.- See Also:
-
getCode
- Specified by:
getCodein interfaceValidationResult- Returns:
- the failure code or
nullifvalid. For a singleValidationFailurethis will be theIDof the failingValidator. The code is a stable identifier that indicates the type of the failure. It can be used for automated testing in order to make the test-cases independent from the actual message texts so they are maintainable and will not break e.g. if typos are fixed in the messages. - See Also:
-
add
- Specified by:
addin interfaceValidationResult- Parameters:
result- anotherValidationResultto combine with this one.- Returns:
- the
ValidationResultcomposed out of this with the givenresult. - See Also:
-
toString
-
get
- Returns:
- the singleton instance of this class.
-