|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.skyscreamer.jsonassert.JSONCompareResult
public class JSONCompareResult
Bean for holding results from JSONCompare.
| Constructor Summary | |
|---|---|
JSONCompareResult()
Default constructor. |
|
| Method Summary | |
|---|---|
void |
fail(String message)
|
JSONCompareResult |
fail(String field,
Object expected,
Object actual)
Identify that the comparison failed |
boolean |
failed()
Did the comparison fail? |
Object |
getActual()
Deprecated. Superseded by getFieldFailures() |
Object |
getExpected()
Deprecated. Superseded by getFieldFailures() |
String |
getField()
Deprecated. Superseded by getFieldFailures() |
List<FieldComparisonFailure> |
getFieldFailures()
Get the list of failures on field comparisons |
String |
getMessage()
Result message |
boolean |
isFailureOnField()
Check if comparison failed on any particular fields |
JSONCompareResult |
missing(String field,
Object expected)
|
boolean |
passed()
Did the comparison pass? |
String |
toString()
|
JSONCompareResult |
unexpected(String field,
Object value)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public JSONCompareResult()
| Method Detail |
|---|
public boolean passed()
public boolean failed()
public String getMessage()
public List<FieldComparisonFailure> getFieldFailures()
public Object getActual()
getFieldFailures()
JSONObject, JSONArray or other Object
instance, or null if the comparison did not fail on a
particular fieldpublic Object getExpected()
getFieldFailures()
JSONObject, JSONArray or other Object
instance, or null if the comparison did not fail on a
particular fieldpublic boolean isFailureOnField()
public String getField()
getFieldFailures()
String instance, or null if the comparison did
not fail on a particular fieldpublic void fail(String message)
public JSONCompareResult fail(String field,
Object expected,
Object actual)
field - Which field failedexpected - Expected resultactual - Actual result
public JSONCompareResult missing(String field,
Object expected)
public JSONCompareResult unexpected(String field,
Object value)
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||