public final class Message extends Object implements Comparable<Message>
A validation message consists of three mandatory fields and optional information. The three mandatory fields are:
Domain
);Supplementary information can be added via the different .addInfo()
methods.
Example of the JSON representation of one message:
{ "domain": "validation", "keyword": "maxItems", "message": "too many elements in array", "maxItems": 4, "found": 5 }
You cannot instantiate this class directly: use Domain.newMessage()
for that.
This class is immutable.
Message.Builder
,
ValidationReport
Modifier and Type | Class and Description |
---|---|
static class |
Message.Builder
Builder class for a
Message |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Message o)
Implementation of
Comparable for this class |
boolean |
equals(Object obj) |
Domain |
getDomain() |
String |
getKeyword() |
String |
getMessage() |
int |
hashCode() |
boolean |
isFatal() |
JsonNode |
toJsonNode() |
String |
toString() |
public Domain getDomain()
public String getKeyword()
public String getMessage()
public boolean isFatal()
public JsonNode toJsonNode()
public int compareTo(Message o)
Comparable
for this class
The compared fields are the three mandatory parameters. Note that whether the message is fatal has no influence here, since if a message is fatal it will be the only reported message.
compareTo
in interface Comparable<Message>
o
- the message to compare toCopyright © 2013. All Rights Reserved.