java.lang.Object
io.github.mmm.validation.AbstractValidationResult
io.github.mmm.validation.ComposedValidationFailure
- All Implemented Interfaces:
Localizable,LocalizableObject,Composable<ValidationResult>,ValidationResult,Iterable<ValidationResult>
- Since:
- 1.0.0
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionComposedValidationFailure(String source, boolean appendSources, ValidationResult... failures) The constructor.ComposedValidationFailure(String source, ValidationResult... failures) The constructor.ComposedValidationFailure(String code, String source, boolean appendSources, ValidationResult... failures) The constructor. -
Method Summary
Modifier and TypeMethodDescriptionadd(ValidationResult result) booleancontainsCode(String code) getChild(int index) intprotected voidgetLocalizedMessage(String indent, Locale locale, Appendable buffer, boolean verbose, boolean appendSrc) voidgetLocalizedMessage(Locale locale, Appendable buffer, boolean verbose) protected StringbooleanMethods inherited from class io.github.mmm.validation.AbstractValidationResult
appendCode, getCode, getSource, isValid, toStringMethods 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, getLocalizedMessage, getLocalizedMessage, toLocalizableMethods inherited from interface io.github.mmm.validation.ValidationResult
getLocalizedMessage, getLocalizedMessage, getLocalizedMessage, getMessage, getMessage
-
Field Details
-
CODE
-
-
Constructor Details
-
ComposedValidationFailure
The constructor.- Parameters:
source- the optionalsource. May benull.failures- theinvalidValidationResults to compose.
-
ComposedValidationFailure
public ComposedValidationFailure(String source, boolean appendSources, ValidationResult... failures) The constructor.- Parameters:
source- the optionalsource. May benull.appendSources- theappend sources flag.failures- theinvalidValidationResults to compose.
-
ComposedValidationFailure
public ComposedValidationFailure(String code, String source, boolean appendSources, ValidationResult... failures) The constructor.- Parameters:
code- thecode.appendSources- theappend sources flag.source- the optionalsource. May benull.failures- theinvalidValidationResults to compose.
-
-
Method Details
-
isAppendSources
public boolean isAppendSources()- Returns:
trueto append thesources of theValidationFailures to themessage,falseotherwise.
-
getSeparator
- Returns:
- the line separator.
-
getChildCount
public int getChildCount() -
getChild
-
getLocalizedMessage
- Parameters:
locale- is theLocaleto translate to.buffer- theAppendablewhere towritethe message to.verbose- the verbose flag (to includecode(s), etc.- See Also:
-
getLocalizedMessage
protected void getLocalizedMessage(String indent, Locale locale, Appendable buffer, boolean verbose, boolean appendSrc) - Parameters:
indent- the current indentation.locale- theLocaleto translate to.buffer- theAppendablewhere towritethe message to.verbose- the verbose flag (to includecode(s), etc.appendSrc- theappend sources flag.- See Also:
-
add
- Parameters:
result- anotherValidationResultto combine with this one.- Returns:
- the
ValidationResultcomposed out of this with the givenresult. - See Also:
-
containsCode
- Parameters:
code- thecodeto check for.- Returns:
trueif thisValidationResultitselfhasthe givencodeor recursivelycontainssuchValidationResults,falseotherwise.
-