类 ErrorAttributeOptions
java.lang.Object
org.springframework.boot.web.error.ErrorAttributeOptions
Options controlling the contents of
ErrorAttributes
.- 从以下版本开始:
- 2.3.0
- 作者:
- Scott Frederick, Phillip Webb
-
嵌套类概要
嵌套类修饰符和类型类说明static enum
Error attributes that can be included in an error response. -
方法概要
修饰符和类型方法说明static 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.void
retainIncluded
(Map<String, Object> map) Remove elements from the given map if they are not included in this set of options.
-
方法详细资料
-
isIncluded
Get the option for including the specified attribute in the error response.- 参数:
include
- error attribute to get- 返回:
true
if theInclude
attribute is included in the error response,false
otherwise
-
getIncludes
Get all options for including attributes in the error response.- 返回:
- the options
-
including
Return anErrorAttributeOptions
that includes the specified attributeErrorAttributeOptions.Include
options.- 参数:
includes
- error attributes to include- 返回:
- an
ErrorAttributeOptions
-
excluding
Return anErrorAttributeOptions
that excludes the specified attributeErrorAttributeOptions.Include
options.- 参数:
excludes
- error attributes to exclude- 返回:
- an
ErrorAttributeOptions
-
retainIncluded
Remove elements from the given map if they are not included in this set of options.- 参数:
map
- the map to update- 从以下版本开始:
- 3.2.7
-
defaults
Create anErrorAttributeOptions
with defaults.- 返回:
- an
ErrorAttributeOptions
-
of
Create anErrorAttributeOptions
that includes the specified attributeErrorAttributeOptions.Include
options.- 参数:
includes
- error attributes to include- 返回:
- an
ErrorAttributeOptions
-
of
Create anErrorAttributeOptions
that includes the specified attributeErrorAttributeOptions.Include
options.- 参数:
includes
- error attributes to include- 返回:
- an
ErrorAttributeOptions
-