public class Result
extends java.lang.Object
Constructor and Description |
---|
Result(int status)
Create a result with no entity.
|
Result(int status,
HttpEntity body)
Create a result.
|
Result(int status,
java.util.Map<java.lang.String,java.lang.String> headers)
Create a result with no body.
|
Result(int status,
java.util.Map<java.lang.String,java.lang.String> headers,
HttpEntity body)
Create a result.
|
Result(int status,
java.util.Optional<java.lang.String> reasonPhrase,
java.util.Map<java.lang.String,java.lang.String> headers,
HttpEntity body)
Create a result.
|
Result(play.api.mvc.ResponseHeader header,
HttpEntity body)
Create a result from a Scala ResponseHeader and a body.
|
Modifier and Type | Method and Description |
---|---|
Result |
as(java.lang.String contentType)
Return a copy of the result with a different Content-Type header.
|
play.api.mvc.Result |
asScala()
Convert this result to a Scala result.
|
HttpEntity |
body()
Get the body of this result.
|
java.util.Optional<java.lang.String> |
charset()
Extracts the Charset of this Result value.
|
java.util.Optional<java.lang.String> |
contentType()
Extracts the Content-Type of this Result value.
|
Http.Cookie |
cookie(java.lang.String name)
Extracts a Cookie value from this Result value
|
Http.Cookies |
cookies()
Extracts the Cookies (an iterator) from this result value.
|
Http.Flash |
flash()
Extracts the Flash values of this Result value.
|
protected play.api.mvc.ResponseHeader |
header()
Get the response header
|
java.util.Optional<java.lang.String> |
header(java.lang.String header)
Extracts an Header value of this Result value.
|
java.util.Map<java.lang.String,java.lang.String> |
headers()
Extracts all Headers of this Result value.
|
java.util.Optional<java.lang.String> |
reasonPhrase()
Get the reason phrase, if it was set.
|
java.util.Optional<java.lang.String> |
redirectLocation()
Extracts the Location header of this Result value if this Result is a Redirect.
|
Http.Session |
session()
Extracts the Session of this Result value.
|
int |
status()
Get the status.
|
Result |
withHeader(java.lang.String name,
java.lang.String value)
Return a copy of this result with the given header.
|
Result |
withHeaders(java.lang.String... nameValues)
Return a copy of this result with the given headers.
|
public Result(play.api.mvc.ResponseHeader header, HttpEntity body)
public Result(int status, java.util.Optional<java.lang.String> reasonPhrase, java.util.Map<java.lang.String,java.lang.String> headers, HttpEntity body)
status
- The status.reasonPhrase
- The reason phrase, if a non default reason phrase is required.headers
- The headers.body
- The body.public Result(int status, java.util.Map<java.lang.String,java.lang.String> headers, HttpEntity body)
status
- The status.headers
- The headers.body
- The body.public Result(int status, java.util.Map<java.lang.String,java.lang.String> headers)
status
- The status.headers
- The headers.public Result(int status, HttpEntity body)
status
- The status.body
- The entity.public Result(int status)
status
- The status.public int status()
public java.util.Optional<java.lang.String> reasonPhrase()
protected play.api.mvc.ResponseHeader header()
public HttpEntity body()
public java.util.Optional<java.lang.String> redirectLocation()
public java.util.Optional<java.lang.String> header(java.lang.String header)
public java.util.Map<java.lang.String,java.lang.String> headers()
public java.util.Optional<java.lang.String> contentType()
public java.util.Optional<java.lang.String> charset()
public Http.Flash flash()
public Http.Session session()
public Http.Cookie cookie(java.lang.String name)
public Http.Cookies cookies()
public Result withHeader(java.lang.String name, java.lang.String value)
public Result withHeaders(java.lang.String... nameValues)
public Result as(java.lang.String contentType)
public play.api.mvc.Result asScala()