Interface RestResponse
- All Superinterfaces:
CustomTransformer
- All Known Implementing Classes:
AbstractRestResponse
,DefaultRestResponse
Base class that represents an HTTP response for a REST resource.
- Since:
- 6.2.0
-
Method Summary
Modifier and TypeMethodDescriptionaccepted()
Add the given single header value to the current list of values for the given header.conflict()
created()
defaultContentType
(MediaType defaultContentType) favorPathExtension
(boolean favorPathExtension) getData()
getName()
int
ignoreAcceptHeader
(boolean ignoreAcceptHeader) ignoreUnknownPathExtensions
(boolean ignoreUnknownPathExtensions) boolean
boolean
boolean
boolean
notFound()
ok()
prettyPrint
(boolean prettyPrint) seeOther()
Specifies response data.Specifies response data with a name.void
setDefaultContentType
(MediaType defaultContentType) void
setDefaultContentType
(String defaultContentType) void
setFavorPathExtension
(boolean favorPathExtension) Set the given single header value under the given header name.void
setIgnoreAcceptHeader
(boolean ignoreAcceptHeader) void
setIgnoreUnknownPathExtensions
(boolean ignoreUnknownPathExtensions) void
setPrettyPrint
(boolean prettyPrint) Sets whether to apply indentations and line breaks when generating response data.setStatus
(int status) setStatus
(HttpStatus status) Methods inherited from interface com.aspectran.core.activity.response.transform.CustomTransformer
transform
-
Method Details
-
getName
String getName() -
getData
Object getData() -
setData
Specifies response data.- Parameters:
data
- the response data
-
setData
Specifies response data with a name.- Parameters:
name
- the name of the response datadata
- the response data
-
isPrettyPrint
boolean isPrettyPrint() -
setPrettyPrint
void setPrettyPrint(boolean prettyPrint) Sets whether to apply indentations and line breaks when generating response data.- Parameters:
prettyPrint
- true if responding with indentations and line breaks; otherwise false
-
prettyPrint
-
isFavorPathExtension
boolean isFavorPathExtension() -
setFavorPathExtension
void setFavorPathExtension(boolean favorPathExtension) -
favorPathExtension
-
isIgnoreUnknownPathExtensions
boolean isIgnoreUnknownPathExtensions() -
setIgnoreUnknownPathExtensions
void setIgnoreUnknownPathExtensions(boolean ignoreUnknownPathExtensions) -
ignoreUnknownPathExtensions
-
isIgnoreAcceptHeader
boolean isIgnoreAcceptHeader() -
setIgnoreAcceptHeader
void setIgnoreAcceptHeader(boolean ignoreAcceptHeader) -
ignoreAcceptHeader
-
getDefaultContentType
MediaType getDefaultContentType() -
setDefaultContentType
-
setDefaultContentType
-
defaultContentType
-
ok
RestResponse ok() -
created
RestResponse created() -
created
-
accepted
RestResponse accepted() -
noContent
RestResponse noContent() -
movedPermanently
RestResponse movedPermanently() -
seeOther
RestResponse seeOther() -
notModified
RestResponse notModified() -
temporaryRedirect
RestResponse temporaryRedirect() -
badRequest
RestResponse badRequest() -
unauthorized
RestResponse unauthorized() -
forbidden
RestResponse forbidden() -
notFound
RestResponse notFound() -
methodNotAllowed
RestResponse methodNotAllowed() -
notAcceptable
RestResponse notAcceptable() -
conflict
RestResponse conflict() -
preconditionFailed
RestResponse preconditionFailed() -
unsupportedMediaType
RestResponse unsupportedMediaType() -
internalServerError
RestResponse internalServerError() -
getStatus
int getStatus() -
setStatus
-
setStatus
-
setHeader
Set the given single header value under the given header name.- Parameters:
name
- the header namevalue
- the header value to set
-
addHeader
Add the given single header value to the current list of values for the given header.- Parameters:
name
- the header namevalue
- the header value to be added
-