public final class ValidationFailureSuccess extends Object implements ValidationFailure
ValidationFailure
representing success used as internal representation where
null
is not suitable.Modifier and Type | Field and Description |
---|---|
static ValidationFailureSuccess |
INSTANCE
The singleton instance.
|
private static long |
serialVersionUID |
TYPE_INFORMATION, TYPE_TECHNICAL_ERROR, TYPE_USER_ERROR, TYPE_VALIDATION_FAILURE, TYPE_WARNING
Modifier | Constructor and Description |
---|---|
private |
ValidationFailureSuccess()
The constructor.
|
Modifier and Type | Method and Description |
---|---|
String |
getCode()
This method gets the code of this
ValidationFailure . |
String |
getDetails()
This method gets optional details for this message.
|
String |
getMessage()
This method gets the message of the validation failure.
|
String |
getMessage(Locale locale)
|
String |
getSource()
This method gets the (optional)
source of the validation. |
String |
getType()
This method gets the type of this
Message . |
UUID |
getUuid()
This method gets the
UUID of this object. |
private static final long serialVersionUID
public static ValidationFailureSuccess INSTANCE
public String getDetails()
Message
getDetails
in interface Message
null
if no additional details are available.public String getType()
Message
Message
. This should be one of the following options:
ValidationFailure
.error
caused by the
end-user (e.g. by providing invalid data). Unlike Message.TYPE_VALIDATION_FAILURE
this is an actual error that has
been detected after a successful validation.error
related to a
technical problem (e.g. programming failure such as NullPointerException
or operational error like
ConnectException
).public UUID getUuid()
Message
UUID
of this object. When the object is created, a UUID
is generated. In case
the object is created from another object that already has a UUID
, the existing UUID
will be used (e.g. for chained exceptions
). UUID
will appear in a
stacktrace
but NOT
in the message
. It will therefore be written to
log-files if the NlsThrowable
is logged. If you supply the UUID
to
the end-user in an error panel or popup (see Message
), he can provide it with the
problem report so an administrator or software developer can easily find the stacktrace in the log-files.getUuid
in interface AttributeReadUuid
getUuid
in interface Message
UUID
if this Message
. Will typically only be available if type
is
Message.TYPE_TECHNICAL_ERROR
or Message.TYPE_USER_ERROR
. Will be null
if not available.public String getSource()
ValidationFailure
source
of the validation. It
describes the origin of the given value
. This may be the filename where the value was read from, an XPath
where the value was located in an XML document, etc. It can be used to enrich messages
displayed to end-users. This will help to find the problem easier.getSource
in interface Message
getSource
in interface ValidationFailure
null
if NOT available.public String getMessage()
ValidationFailure
usage
the message may also contain the name of the field or
other context information in order to determine the source of the problem.getMessage
in interface AttributeReadMessage
getMessage
in interface ValidationFailure
Throwable.getMessage()
,
NlsThrowable
,
Message
public String getMessage(Locale locale)
ValidationFailure
message
localized for the given Locale
. ValidationFailure.getMessage()
ignoring the lcoale.getMessage
in interface Message
getMessage
in interface ValidationFailure
locale
- is the Locale
.public String getCode()
ValidationFailure
ValidationFailure
. 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.getCode
in interface AttributeReadMessageCode
getCode
in interface ValidationFailure
Throwable.getMessage()
,
NlsThrowable
,
Message
Copyright © 2001–2016 mmm-Team. All rights reserved.