Package dev.voidframework.web.http
Class Result
java.lang.Object
dev.voidframework.web.http.Result
An HTTP result.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic ResultbadRequest(byte[] content, String contentType) Bad request (400).static ResultbadRequest(com.fasterxml.jackson.databind.JsonNode content) Bad request (400).static ResultbadRequest(TemplateResult templateResult) Bad request (400).static ResultbadRequest(String content) Bad request (400).static ResultCreated (201).static Resultcreated(com.fasterxml.jackson.databind.JsonNode content) Created (201).static Resultcreated(TemplateResult templateResult) Created (201).static ResultCreated (201).static ResultForbidden (403).static Resultforbidden(com.fasterxml.jackson.databind.JsonNode content) Forbidden (403).static Resultforbidden(TemplateResult templateResult) Forbidden (403).static ResultForbidden (403).Gets the content type.Gets all cookies.Gets all headers.intGets the HTTP return code.Get tje result processor.static ResultinternalServerError(byte[] content, String contentType) Internal Server Error (500).static ResultinternalServerError(com.fasterxml.jackson.databind.JsonNode content) Internal Server Error (500).static ResultinternalServerError(TemplateResult templateResult) Internal Server Error (500).static ResultinternalServerError(String content) Internal Server Error (500).static ResultNo Content (204).static ResultNot Found (404).static ResultnotFound(com.fasterxml.jackson.databind.JsonNode content) Not Found (404).static ResultnotFound(TemplateResult templateResult) Not Found (404).static ResultNot Found (404).static ResultnotImplemented(byte[] content, String contentType) Not Implemented (501).static ResultnotImplemented(com.fasterxml.jackson.databind.JsonNode content) Not Implemented (501).static ResultnotImplemented(TemplateResult templateResult) Not Implemented (501).static ResultnotImplemented(String content) Not Implemented (501).static ResultOk (200).static Resultok(com.fasterxml.jackson.databind.JsonNode content) Ok (200).static Resultok(TemplateResult templateResult) Ok (200).static Resultok(InputStream content, String contentType) Ok (200).static ResultOk (200).static ResultRedirect Permanently (301).static ResultRedirect Temporary (302).withCookie(Cookie cookie) Assigns a new cookie.withHeader(String headerName, String value) Assigns a new header.withoutCookie(Cookie cookie) Removes a cookie.withoutCookie(String cookieName) Removes a cookie.withoutHeader(String headerName) Removes a header.
-
Method Details
-
badRequest
Bad request (400).- Parameters:
content- The content- Returns:
- A result
-
badRequest
Bad request (400).- Parameters:
content- The contentcontentType- The content type- Returns:
- A result
-
badRequest
Bad request (400).- Parameters:
content- The JSON content- Returns:
- A result
-
badRequest
Bad request (400).- Parameters:
templateResult- The template to render- Returns:
- A result
-
created
Created (201).- Parameters:
content- The content- Returns:
- A result
-
created
Created (201).- Parameters:
content- The contentcontentType- The content type- Returns:
- A result
-
created
Created (201).- Parameters:
content- The JSON content- Returns:
- A result
-
created
Created (201).- Parameters:
templateResult- The template to render- Returns:
- A result
-
forbidden
Forbidden (403).- Parameters:
content- The content- Returns:
- A result
-
forbidden
Forbidden (403).- Parameters:
content- The contentcontentType- The content type- Returns:
- A result
-
forbidden
Forbidden (403).- Parameters:
content- The JSON content- Returns:
- A result
-
forbidden
Forbidden (403).- Parameters:
templateResult- The template to render- Returns:
- A result
-
internalServerError
Internal Server Error (500).- Parameters:
content- The content- Returns:
- A result
-
internalServerError
Internal Server Error (500).- Parameters:
content- The contentcontentType- The content type- Returns:
- A result
-
internalServerError
Internal Server Error (500).- Parameters:
content- The JSON content- Returns:
- A result
-
internalServerError
Internal Server Error (500).- Parameters:
templateResult- The template to render- Returns:
- A result
-
noContent
No Content (204).- Returns:
- A result
-
notFound
Not Found (404).- Parameters:
content- The content- Returns:
- A result
-
notFound
Not Found (404).- Parameters:
content- The contentcontentType- The content type- Returns:
- A result
-
notFound
Not Found (404).- Parameters:
content- The JSON content- Returns:
- A result
-
notFound
Not Found (404).- Parameters:
templateResult- The template to render- Returns:
- A result
-
notImplemented
Not Implemented (501).- Parameters:
content- The content- Returns:
- A result
-
notImplemented
Not Implemented (501).- Parameters:
content- The contentcontentType- The content type- Returns:
- A result
-
notImplemented
Not Implemented (501).- Parameters:
content- The JSON content- Returns:
- A result
-
notImplemented
Not Implemented (501).- Parameters:
templateResult- The template to render- Returns:
- A result
-
ok
Ok (200).- Parameters:
content- The content- Returns:
- A result
-
ok
Ok (200).- Parameters:
content- The contentcontentType- The content type- Returns:
- A result
-
ok
Ok (200).- Parameters:
content- The input stream contentcontentType- The content type- Returns:
- A result
-
ok
Ok (200).- Parameters:
content- The JSON content- Returns:
- A result
-
ok
Ok (200).- Parameters:
templateResult- The template to render- Returns:
- A result
-
redirectPermanentlyTo
Redirect Permanently (301).- Parameters:
uri- The URL to redirect to- Returns:
- A result
-
redirectTemporaryTo
Redirect Temporary (302).- Parameters:
uri- The URL to redirect to- Returns:
- A result
-
withCookie
Assigns a new cookie.- Parameters:
cookie- The cookie to assign- Returns:
- The current result
-
withoutCookie
Removes a cookie.- Parameters:
cookie- The cookie to remove- Returns:
- The current result
-
withoutCookie
Removes a cookie.- Parameters:
cookieName- Name of the cookie to remove- Returns:
- The current result
-
withHeader
Assigns a new header.- Parameters:
headerName- Name of the headervalue- Value to assign- Returns:
- The current result
-
withoutHeader
Removes a header.- Parameters:
headerName- Name of the header to remove- Returns:
- The current result
-
getCookies
Gets all cookies.- Returns:
- All cookies
-
getHeaders
Gets all headers.- Returns:
- All headers
-
getHttpCode
public int getHttpCode()Gets the HTTP return code.- Returns:
- The HTTP return code
-
getContentType
Gets the content type.- Returns:
- The content type
-
getResultProcessor
Get tje result processor.- Returns:
- The result processor
-