@RenderWith(value=JsonActionResult.class) public class JsonResult extends java.lang.Object
Constructor and Description |
---|
JsonResult(java.lang.String body) |
Modifier and Type | Method and Description |
---|---|
static JsonResult |
empty()
Creates a JSON result with empty body.
|
java.lang.String |
message()
Returns response message.
|
static JsonResult |
of(java.lang.Exception exception)
Creates a JSON response from an exception.
|
static JsonResult |
of(HttpStatus httpStatus)
Creates a JSON result with empty body and given status.
|
static JsonResult |
of(java.lang.Object object)
Creates JSON result from given object.
|
static JsonResult |
of(java.lang.String json)
Creates new JSON result of provided JSON string.
|
int |
status()
Returns response status.
|
JsonResult |
status(HttpStatus httpStatus) |
JsonResult |
status(int status) |
JsonResult |
status(int status,
java.lang.String message) |
java.lang.String |
value()
Returns JSON body.
|
public static JsonResult of(java.lang.String json)
public static JsonResult of(java.lang.Object object)
public static JsonResult of(HttpStatus httpStatus)
public static JsonResult of(java.lang.Exception exception)
public static JsonResult empty()
public JsonResult status(int status)
public JsonResult status(HttpStatus httpStatus)
public JsonResult status(int status, java.lang.String message)
public java.lang.String value()
public int status()
public java.lang.String message()
Copyright © 2003-present Jodd Team