Class ErrorAttributeOptions
java.lang.Object
org.springframework.boot.web.error.ErrorAttributeOptions
Options controlling the contents of
ErrorAttributes
.- Since:
- 2.3.0
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Error attributes that can be included in an error response. -
Method Summary
Modifier and TypeMethodDescriptionstatic ErrorAttributeOptions
defaults()
Create anErrorAttributeOptions
with defaults.excluding
(ErrorAttributeOptions.Include... excludes) Return anErrorAttributeOptions
that excludes the specified attributeErrorAttributeOptions.Include
options.Get all options for including attributes in the error response.including
(ErrorAttributeOptions.Include... includes) Return anErrorAttributeOptions
that includes the specified attributeErrorAttributeOptions.Include
options.boolean
isIncluded
(ErrorAttributeOptions.Include include) Get the option for including the specified attribute in the error response.static ErrorAttributeOptions
of
(Collection<ErrorAttributeOptions.Include> includes) Create anErrorAttributeOptions
that includes the specified attributeErrorAttributeOptions.Include
options.static ErrorAttributeOptions
of
(ErrorAttributeOptions.Include... includes) Create anErrorAttributeOptions
that includes the specified attributeErrorAttributeOptions.Include
options.
-
Method Details
-
isIncluded
Get the option for including the specified attribute in the error response.- Parameters:
include
- error attribute to get- Returns:
true
if theInclude
attribute is included in the error response,false
otherwise
-
getIncludes
Get all options for including attributes in the error response.- Returns:
- the options
-
including
Return anErrorAttributeOptions
that includes the specified attributeErrorAttributeOptions.Include
options.- Parameters:
includes
- error attributes to include- Returns:
- an
ErrorAttributeOptions
-
excluding
Return anErrorAttributeOptions
that excludes the specified attributeErrorAttributeOptions.Include
options.- Parameters:
excludes
- error attributes to exclude- Returns:
- an
ErrorAttributeOptions
-
defaults
Create anErrorAttributeOptions
with defaults.- Returns:
- an
ErrorAttributeOptions
-
of
Create anErrorAttributeOptions
that includes the specified attributeErrorAttributeOptions.Include
options.- Parameters:
includes
- error attributes to include- Returns:
- an
ErrorAttributeOptions
-
of
Create anErrorAttributeOptions
that includes the specified attributeErrorAttributeOptions.Include
options.- Parameters:
includes
- error attributes to include- Returns:
- an
ErrorAttributeOptions
-