public class ImmutableValidationResult extends Object implements ValidationResult
ValidationResult. It provides a series of static factory methods for creating a result
in which the validation succeeded (ok()), and other two for validations that failed (error(I18nMessage) and
error(String)).| Modifier and Type | Method and Description |
|---|---|
static ValidationResult |
error(org.mule.runtime.api.i18n.I18nMessage message)
|
static ValidationResult |
error(String message)
|
String |
getMessage()
Returns a message associated with the execution of the validation.
|
boolean |
isError()
Whether the validation has failed or not
|
static ValidationResult |
ok()
|
public static ValidationResult error(String message)
message - a messageImmutableValidationResultpublic static ValidationResult error(org.mule.runtime.api.i18n.I18nMessage message)
message - a messageImmutableValidationResultpublic static ValidationResult ok()
ImmutableValidationResult without message and which isError() method returns false. Since
this class is immutable, the same instance is always returnedOKpublic String getMessage()
ValidationResult.isError() is true), then it will contain the reason why the error was generated. Otherwise, it might or
might not contain some additional consideration about the validation resultgetMessage in interface ValidationResultString or nullpublic boolean isError()
isError in interface ValidationResultfalse otherwiseCopyright © 2017 MuleSoft, Inc.. All rights reserved.