Package com.oracle.bmc.http.internal
Enum ResponseErrorBmcExceptionFactory
- java.lang.Object
-
- java.lang.Enum<ResponseErrorBmcExceptionFactory>
-
- com.oracle.bmc.http.internal.ResponseErrorBmcExceptionFactory
-
- All Implemented Interfaces:
ResponseErrorRuntimeExceptionFactory<ResponseHelper.ErrorCodeAndMessage,BmcException>,Serializable,Comparable<ResponseErrorBmcExceptionFactory>
public enum ResponseErrorBmcExceptionFactory extends Enum<ResponseErrorBmcExceptionFactory> implements ResponseErrorRuntimeExceptionFactory<ResponseHelper.ErrorCodeAndMessage,BmcException>
DefaultResponseErrorRuntimeExceptionFactoryimplementation that knows how to deserialize error responses using theResponseHelper.ErrorCodeAndMessagemodel.When an error response is received and deserialized, a
BmcExceptionis thrown, allowing access to the error object.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description INSTANCEThe single stateless ResponseErrorBmcExceptionFactory instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description BmcExceptioncreateRuntimeException(int statusCode, String opcRequestId, ResponseHelper.ErrorCodeAndMessage errorResponse, ServiceDetails serviceDetails)BmcExceptioncreateRuntimeException(int statusCode, String serviceCode, String message, String opcRequestId, ServiceDetails serviceDetails)BmcExceptioncreateRuntimeException(int statusCode, String serviceCode, String message, String opcRequestId, Throwable cause, ServiceDetails serviceDetails)Class<ResponseHelper.ErrorCodeAndMessage>getResponseErrorModelType()static ResponseErrorBmcExceptionFactoryvalueOf(String name)Returns the enum constant of this type with the specified name.static ResponseErrorBmcExceptionFactory[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
INSTANCE
public static final ResponseErrorBmcExceptionFactory INSTANCE
The single stateless ResponseErrorBmcExceptionFactory instance.
-
-
Method Detail
-
values
public static ResponseErrorBmcExceptionFactory[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (ResponseErrorBmcExceptionFactory c : ResponseErrorBmcExceptionFactory.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ResponseErrorBmcExceptionFactory valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
getResponseErrorModelType
public Class<ResponseHelper.ErrorCodeAndMessage> getResponseErrorModelType()
- Specified by:
getResponseErrorModelTypein interfaceResponseErrorRuntimeExceptionFactory<ResponseHelper.ErrorCodeAndMessage,BmcException>- Returns:
- This implementation returns the
ResponseHelper.ErrorCodeAndMessageclass object.
-
createRuntimeException
public BmcException createRuntimeException(int statusCode, String opcRequestId, ResponseHelper.ErrorCodeAndMessage errorResponse, ServiceDetails serviceDetails)
- Specified by:
createRuntimeExceptionin interfaceResponseErrorRuntimeExceptionFactory<ResponseHelper.ErrorCodeAndMessage,BmcException>
-
createRuntimeException
public BmcException createRuntimeException(int statusCode, String serviceCode, String message, String opcRequestId, ServiceDetails serviceDetails)
- Specified by:
createRuntimeExceptionin interfaceResponseErrorRuntimeExceptionFactory<ResponseHelper.ErrorCodeAndMessage,BmcException>
-
createRuntimeException
public BmcException createRuntimeException(int statusCode, String serviceCode, String message, String opcRequestId, Throwable cause, ServiceDetails serviceDetails)
- Specified by:
createRuntimeExceptionin interfaceResponseErrorRuntimeExceptionFactory<ResponseHelper.ErrorCodeAndMessage,BmcException>
-
-