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(Message)
and error(String)
).Modifier and Type | Method and Description |
---|---|
static ValidationResult |
error(Message 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 messageImmutableValidationResult
public static ValidationResult error(Message message)
message
- a messageImmutableValidationResult
public static ValidationResult ok()
ImmutableValidationResult
without message and
which isError()
method returns false
. Since this
class is immutable, the same instance is always returnedOK
public 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 ValidationResult
String
or null
public boolean isError()
isError
in interface ValidationResult
false
otherwiseCopyright © 2003–2016 MuleSoft, Inc.. All rights reserved.