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
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableExceptionMapping. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forImmutableExceptionMapping.static ImmutableExceptionMappingCreates an immutable copy of aRestApiExceptionMapperProperties.ExceptionMappingvalue.booleanThis instance is equal to all instances ofImmutableExceptionMappingthat have equal attribute values.getCode()Gets code.Gets exception class name.Gets message.intGets status.inthashCode()Computes a hash code from attributes:exceptionClassName,status,message,code.toString()Prints the immutable valueExceptionMappingwith attribute values.Copy the current immutable object by setting a value for thecodeattribute.withExceptionClassName(String value) Copy the current immutable object by setting a value for theexceptionClassNameattribute.withMessage(String value) Copy the current immutable object by setting a value for themessageattribute.withStatus(int value) Copy the current immutable object by setting a value for thestatusattribute.
-
Method Details
-
getExceptionClassName
Gets exception class name.- Specified by:
getExceptionClassNamein interfaceRestApiExceptionMapperProperties.ExceptionMapping- Returns:
- the exception class name
-
getStatus
public int getStatus()Gets status.- Specified by:
getStatusin interfaceRestApiExceptionMapperProperties.ExceptionMapping- Returns:
- the status
-
getMessage
Gets message.- Specified by:
getMessagein interfaceRestApiExceptionMapperProperties.ExceptionMapping- Returns:
- the message
-
getCode
Gets code.- Specified by:
getCodein interfaceRestApiExceptionMapperProperties.ExceptionMapping- Returns:
- the code
-
withExceptionClassName
Copy the current immutable object by setting a value for theexceptionClassNameattribute. 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
thisobject
-
withStatus
Copy the current immutable object by setting a value for thestatusattribute. 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
thisobject
-
withMessage
Copy the current immutable object by setting a value for themessageattribute. 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
thisobject
-
withCode
Copy the current immutable object by setting a value for thecodeattribute. 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
thisobject
-
equals
This instance is equal to all instances ofImmutableExceptionMappingthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:exceptionClassName,status,message,code. -
toString
Prints the immutable valueExceptionMappingwith attribute values. -
copyOf
public static ImmutableExceptionMapping copyOf(RestApiExceptionMapperProperties.ExceptionMapping instance) Creates an immutable copy of aRestApiExceptionMapperProperties.ExceptionMappingvalue. 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) // requiredexceptionClassName.status(int) // optionalstatus.message(String | null) // nullablemessage.code(String | null) // nullablecode.build();- Returns:
- A new ImmutableExceptionMapping builder
-