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