Class ImmutableExceptionMappingConfig.Builder
- Enclosing class:
- ImmutableExceptionMappingConfig
ImmutableExceptionMappingConfig
.
Initialize attributes and then invoke the build()
method to create an
immutable instance.
Builder
is not thread-safe and generally should not be stored in a field or collection,
but instead used immediately to create instances.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds a newImmutableExceptionMappingConfig
.evaluateAnnotationFirst
(Boolean evaluateAnnotationFirst) Initializes the value for theevaluateAnnotationFirst
attribute.exceptionClassName
(String exceptionClassName) Initializes the value for theexceptionClassName
attribute.Fill a builder with attribute values from the providedExceptionMappingConfig
instance.includeApplicationName
(Boolean includeApplicationName) Initializes the value for theincludeApplicationName
attribute.includeCause
(Boolean includeCause) Initializes the value for theincludeCause
attribute.includeException
(Boolean includeException) Initializes the value for theincludeException
attribute.includeHandler
(Boolean includeHandler) Initializes the value for theincludeHandler
attribute.includeMessage
(Boolean includeMessage) Initializes the value for theincludeMessage
attribute.includePath
(Boolean includePath) Initializes the value for theincludePath
attribute.includeStackTrace
(Boolean includeStackTrace) Initializes the value for theincludeStackTrace
attribute.
-
Method Details
-
from
public final ImmutableExceptionMappingConfig.Builder from(RestApiExceptionMapperProperties.ExceptionMappingConfig instance) Fill a builder with attribute values from the providedExceptionMappingConfig
instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
exceptionClassName
Initializes the value for theexceptionClassName
attribute.- Parameters:
exceptionClassName
- The value for exceptionClassName- Returns:
this
builder for use in a chained invocation
-
includeMessage
Initializes the value for theincludeMessage
attribute.If not set, this attribute will have a default value as returned by the initializer of
includeMessage
.- Parameters:
includeMessage
- The value for includeMessage- Returns:
this
builder for use in a chained invocation
-
includeException
Initializes the value for theincludeException
attribute.If not set, this attribute will have a default value as returned by the initializer of
includeException
.- Parameters:
includeException
- The value for includeException- Returns:
this
builder for use in a chained invocation
-
includeApplicationName
public final ImmutableExceptionMappingConfig.Builder includeApplicationName(Boolean includeApplicationName) Initializes the value for theincludeApplicationName
attribute.If not set, this attribute will have a default value as returned by the initializer of
includeApplicationName
.- Parameters:
includeApplicationName
- The value for includeApplicationName- Returns:
this
builder for use in a chained invocation
-
includePath
Initializes the value for theincludePath
attribute.If not set, this attribute will have a default value as returned by the initializer of
includePath
.- Parameters:
includePath
- The value for includePath- Returns:
this
builder for use in a chained invocation
-
includeHandler
Initializes the value for theincludeHandler
attribute.If not set, this attribute will have a default value as returned by the initializer of
includeHandler
.- Parameters:
includeHandler
- The value for includeHandler- Returns:
this
builder for use in a chained invocation
-
includeStackTrace
Initializes the value for theincludeStackTrace
attribute.If not set, this attribute will have a default value as returned by the initializer of
includeStackTrace
.- Parameters:
includeStackTrace
- The value for includeStackTrace- Returns:
this
builder for use in a chained invocation
-
includeCause
Initializes the value for theincludeCause
attribute.If not set, this attribute will have a default value as returned by the initializer of
includeCause
.- Parameters:
includeCause
- The value for includeCause- Returns:
this
builder for use in a chained invocation
-
evaluateAnnotationFirst
public final ImmutableExceptionMappingConfig.Builder evaluateAnnotationFirst(Boolean evaluateAnnotationFirst) Initializes the value for theevaluateAnnotationFirst
attribute.If not set, this attribute will have a default value as returned by the initializer of
evaluateAnnotationFirst
.- Parameters:
evaluateAnnotationFirst
- The value for evaluateAnnotationFirst- Returns:
this
builder for use in a chained invocation
-
build
Builds a newImmutableExceptionMappingConfig
.- Returns:
- An immutable instance of ExceptionMappingConfig
- Throws:
IllegalStateException
- if any required attributes are missing
-