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 theevaluateAnnotationFirstattribute.exceptionClassName(String exceptionClassName) Initializes the value for theexceptionClassNameattribute.Fill a builder with attribute values from the providedExceptionMappingConfiginstance.includeApplicationName(Boolean includeApplicationName) Initializes the value for theincludeApplicationNameattribute.includeCause(Boolean includeCause) Initializes the value for theincludeCauseattribute.includeException(Boolean includeException) Initializes the value for theincludeExceptionattribute.includeHandler(Boolean includeHandler) Initializes the value for theincludeHandlerattribute.includeMessage(Boolean includeMessage) Initializes the value for theincludeMessageattribute.includePath(Boolean includePath) Initializes the value for theincludePathattribute.includeStackTrace(Boolean includeStackTrace) Initializes the value for theincludeStackTraceattribute.
-
Method Details
-
from
public final ImmutableExceptionMappingConfig.Builder from(RestApiExceptionMapperProperties.ExceptionMappingConfig instance) Fill a builder with attribute values from the providedExceptionMappingConfiginstance. 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:
thisbuilder for use in a chained invocation
-
exceptionClassName
Initializes the value for theexceptionClassNameattribute.- Parameters:
exceptionClassName- The value for exceptionClassName- Returns:
thisbuilder for use in a chained invocation
-
includeMessage
Initializes the value for theincludeMessageattribute.If not set, this attribute will have a default value as returned by the initializer of
includeMessage.- Parameters:
includeMessage- The value for includeMessage- Returns:
thisbuilder for use in a chained invocation
-
includeException
Initializes the value for theincludeExceptionattribute.If not set, this attribute will have a default value as returned by the initializer of
includeException.- Parameters:
includeException- The value for includeException- Returns:
thisbuilder for use in a chained invocation
-
includeApplicationName
public final ImmutableExceptionMappingConfig.Builder includeApplicationName(Boolean includeApplicationName) Initializes the value for theincludeApplicationNameattribute.If not set, this attribute will have a default value as returned by the initializer of
includeApplicationName.- Parameters:
includeApplicationName- The value for includeApplicationName- Returns:
thisbuilder for use in a chained invocation
-
includePath
Initializes the value for theincludePathattribute.If not set, this attribute will have a default value as returned by the initializer of
includePath.- Parameters:
includePath- The value for includePath- Returns:
thisbuilder for use in a chained invocation
-
includeHandler
Initializes the value for theincludeHandlerattribute.If not set, this attribute will have a default value as returned by the initializer of
includeHandler.- Parameters:
includeHandler- The value for includeHandler- Returns:
thisbuilder for use in a chained invocation
-
includeStackTrace
Initializes the value for theincludeStackTraceattribute.If not set, this attribute will have a default value as returned by the initializer of
includeStackTrace.- Parameters:
includeStackTrace- The value for includeStackTrace- Returns:
thisbuilder for use in a chained invocation
-
includeCause
Initializes the value for theincludeCauseattribute.If not set, this attribute will have a default value as returned by the initializer of
includeCause.- Parameters:
includeCause- The value for includeCause- Returns:
thisbuilder for use in a chained invocation
-
evaluateAnnotationFirst
public final ImmutableExceptionMappingConfig.Builder evaluateAnnotationFirst(Boolean evaluateAnnotationFirst) Initializes the value for theevaluateAnnotationFirstattribute.If not set, this attribute will have a default value as returned by the initializer of
evaluateAnnotationFirst.- Parameters:
evaluateAnnotationFirst- The value for evaluateAnnotationFirst- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutableExceptionMappingConfig.- Returns:
- An immutable instance of ExceptionMappingConfig
- Throws:
IllegalStateException- if any required attributes are missing
-