Interface ExceptionCode
public interface ExceptionCode
An interface to model exception code, short description and enable creating
CommonRuntimeException-
Method Summary
Modifier and TypeMethodDescriptionShort description of the error.default org.springframework.http.HttpStatusGet http status.name()Short name of the error/exception code.default CommonRuntimeExceptiontoCommonRTE(String message) ACommonRuntimeExceptiongenerator givendefault CommonRuntimeExceptiontoCommonRTE(String template, Object... args) ACommonRuntimeExceptiongenerator setting the message ofgetDescription()default CommonRuntimeExceptiontoCommonRTE(String message, MessageFormat template, Object... args) ACommonRuntimeExceptiongenerator givendefault CommonRuntimeExceptiontoCommonRTE(String template, Map<String, Object> args) ACommonRuntimeExceptionwith message set withgetDescription()with following other parameters.
-
Method Details
-
name
String name()Short name of the error/exception code.- Returns:
- name/code of the error.
-
getDescription
String getDescription()Short description of the error.- Returns:
- description.
-
getStatus
default org.springframework.http.HttpStatus getStatus()Get http status.- Returns:
HttpStatus
-
toCommonRTE
ACommonRuntimeExceptiongenerator given- Parameters:
message- for Exception- Returns:
CommonRuntimeException
-
toCommonRTE
ACommonRuntimeExceptiongenerator setting the message ofgetDescription()- Parameters:
template- for a detailed message that needs variable interpolated based on substitution markersargs- the parameters to be used to replace the markered template- Returns:
CommonRuntimeException
-
toCommonRTE
ACommonRuntimeExceptionwith message set withgetDescription()with following other parameters.- Parameters:
template- for a detailed message that needs variable interpolated based on substitution markersargs- the parameters to be used to replace the markered template- Returns:
CommonRuntimeException
-
toCommonRTE
ACommonRuntimeExceptiongenerator given- Parameters:
message- for Exceptiontemplate- aformatted detailed messagethat would be processed byMessageFormatargs- the parameters to be used to replace the markers supported byMessageFormat- Returns:
CommonRuntimeException
-