Package org.bremersee.exception
Class ImmutableExceptionMapping
java.lang.Object
org.bremersee.exception.ImmutableExceptionMapping
- All Implemented Interfaces:
RestApiExceptionMapperProperties.ExceptionMapping
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableExceptionMapping
extends Object
implements RestApiExceptionMapperProperties.ExceptionMapping
Immutable implementation of
RestApiExceptionMapperProperties.ExceptionMapping
.
Use the builder to create immutable instances:
ImmutableExceptionMapping.builder()
.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Builds instances of typeImmutableExceptionMapping
. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
Creates a builder forImmutableExceptionMapping
.static ImmutableExceptionMapping
Creates an immutable copy of aRestApiExceptionMapperProperties.ExceptionMapping
value.boolean
This instance is equal to all instances ofImmutableExceptionMapping
that have equal attribute values.getCode()
Gets code.Gets exception class name.Gets message.int
Gets status.int
hashCode()
Computes a hash code from attributes:exceptionClassName
,status
,message
,code
.toString()
Prints the immutable valueExceptionMapping
with attribute values.Copy the current immutable object by setting a value for thecode
attribute.withExceptionClassName
(String value) Copy the current immutable object by setting a value for theexceptionClassName
attribute.withMessage
(String value) Copy the current immutable object by setting a value for themessage
attribute.withStatus
(int value) Copy the current immutable object by setting a value for thestatus
attribute.
-
Method Details
-
getExceptionClassName
Gets exception class name.- Specified by:
getExceptionClassName
in interfaceRestApiExceptionMapperProperties.ExceptionMapping
- Returns:
- the exception class name
-
getStatus
public int getStatus()Gets status.- Specified by:
getStatus
in interfaceRestApiExceptionMapperProperties.ExceptionMapping
- Returns:
- the status
-
getMessage
Gets message.- Specified by:
getMessage
in interfaceRestApiExceptionMapperProperties.ExceptionMapping
- Returns:
- the message
-
getCode
Gets code.- Specified by:
getCode
in interfaceRestApiExceptionMapperProperties.ExceptionMapping
- Returns:
- the code
-
withExceptionClassName
Copy the current immutable object by setting a value for theexceptionClassName
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for exceptionClassName- Returns:
- A modified copy of the
this
object
-
withStatus
Copy the current immutable object by setting a value for thestatus
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for status- Returns:
- A modified copy of the
this
object
-
withMessage
Copy the current immutable object by setting a value for themessage
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for message (can benull
)- Returns:
- A modified copy of the
this
object
-
withCode
Copy the current immutable object by setting a value for thecode
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for code (can benull
)- Returns:
- A modified copy of the
this
object
-
equals
This instance is equal to all instances ofImmutableExceptionMapping
that have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:exceptionClassName
,status
,message
,code
. -
toString
Prints the immutable valueExceptionMapping
with attribute values. -
copyOf
public static ImmutableExceptionMapping copyOf(RestApiExceptionMapperProperties.ExceptionMapping instance) Creates an immutable copy of aRestApiExceptionMapperProperties.ExceptionMapping
value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance
- The instance to copy- Returns:
- A copied immutable ExceptionMapping instance
-
builder
Creates a builder forImmutableExceptionMapping
.ImmutableExceptionMapping.builder() .exceptionClassName(String) // required
exceptionClassName
.status(int) // optionalstatus
.message(String | null) // nullablemessage
.code(String | null) // nullablecode
.build();- Returns:
- A new ImmutableExceptionMapping builder
-