public static final class ErrorResponse.Builder
extends java.lang.Object
ErrorResponse
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
ErrorResponse |
build()
Builds the configured instance.
|
ErrorResponse.Builder |
httpStatus(java.lang.Number httpStatus)
Sets the value of
ErrorResponse.getHttpStatus() |
ErrorResponse.Builder |
responseHttpStatus(java.lang.Number responseHttpStatus)
Sets the value of
ErrorResponse.getResponseHttpStatus() |
ErrorResponse.Builder |
responsePagePath(java.lang.String responsePagePath)
Sets the value of
ErrorResponse.getResponsePagePath() |
ErrorResponse.Builder |
ttl(Duration ttl)
Sets the value of
ErrorResponse.getTtl() |
public ErrorResponse.Builder httpStatus(java.lang.Number httpStatus)
ErrorResponse.getHttpStatus()
httpStatus
- The HTTP status code for which you want to specify a custom error page and/or a caching duration. This parameter is required.this
public ErrorResponse.Builder responseHttpStatus(java.lang.Number responseHttpStatus)
ErrorResponse.getResponseHttpStatus()
responseHttpStatus
- The HTTP status code that you want CloudFront to return to the viewer along with the custom error page.
If you specify a value for responseHttpStatus
, you must also specify a value for responsePagePath
.this
public ErrorResponse.Builder responsePagePath(java.lang.String responsePagePath)
ErrorResponse.getResponsePagePath()
responsePagePath
- The path to the custom error page that you want CloudFront to return to a viewer when your origin returns the `httpStatus`, for example, /4xx-errors/403-forbidden.html.this
public ErrorResponse.Builder ttl(Duration ttl)
ErrorResponse.getTtl()
ttl
- The minimum amount of time, in seconds, that you want CloudFront to cache the HTTP status code specified in ErrorCode.this
public ErrorResponse build()
ErrorResponse
java.lang.NullPointerException
- if any required attribute was not provided