Class ResponseStatusInitializer
java.lang.Object
net.sourceforge.jbizmo.commons.avro.response.ResponseStatusInitializer
Utility class for creating response status objects
Copyright 2021 (C) by Martin Ganserer
- Version:
- 1.0.0
- Author:
- Martin Ganserer
-
Method Summary
Modifier and TypeMethodDescriptionstatic final ResponseStatusfromException(Exception exception) Create a new error response status object based on the provided exceptionstatic final ResponseStatuswith(ResponseCode code, String message) Create a new response status object based on the provided response code and messagestatic final ResponseStatus
-
Method Details
-
withSuccessStatus
- Returns:
- a new
ResponseStatusobject with response codeResponseCode.SUCCESS
-
fromException
Create a new error response status object based on the provided exception- Parameters:
exception-- Returns:
- a new
ResponseStatusobject with response codeResponseCode.ERROR
-
with
Create a new response status object based on the provided response code and message- Parameters:
code-message-- Returns:
- a new
ResponseStatusobject
-