public final class ValidationReport extends Object
It is a simple ListMultimap which associates a path into the
validated instance (as a JsonPointer to a list of validation
messages.
| Modifier and Type | Field and Description |
|---|---|
private ListMultimap<JsonPointer,String> |
msgMap
Message list
|
private JsonPointer |
path
The current path
|
private static JsonPointer |
ROOT
Root JSON Pointer (ie,
#) |
| Modifier | Constructor and Description |
|---|---|
|
ValidationReport()
Create a new validation report with
ROOT as an instance path |
private |
ValidationReport(JsonPointer path)
Create a new validation report with an arbitraty path
|
| Modifier and Type | Method and Description |
|---|---|
void |
addMessage(String message)
Add one message to the current path
|
void |
addMessages(List<String> messages)
Add a list of messages to the current path
|
ValidationReport |
copy()
Make a copy of this validation report, with an empty message map and
the current path.
|
List<String> |
getMessages()
Get a flat list of validation messages
|
JsonPointer |
getPath()
Get the current path of this report
|
boolean |
isSuccess()
Is this report a success?
|
void |
mergeWith(ValidationReport other)
Merge with another validation report
|
void |
setPath(JsonPointer path)
Set the current path of this report
|
private static final JsonPointer ROOT
#)private final ListMultimap<JsonPointer,String> msgMap
private JsonPointer path
public ValidationReport()
ROOT as an instance pathprivate ValidationReport(JsonPointer path)
path - the JSON Pointerpublic JsonPointer getPath()
public void setPath(JsonPointer path)
path - the pathpublic void addMessage(String message)
message - the message to addpublic void addMessages(List<String> messages)
messages - the list of messagespublic boolean isSuccess()
public void mergeWith(ValidationReport other)
other - the report to merge withpublic ValidationReport copy()
Copyright © 2012. All Rights Reserved.