Package io.openems.common.exceptions
Enum Class OpenemsError
- All Implemented Interfaces:
Serializable
,Comparable<OpenemsError>
,Constable
Holds named OpenEMS Errors.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescription -
Method Summary
Modifier and TypeMethodDescriptionCreates a OpenEMS Named Exception from this Error.static OpenemsError
fromCode
(int code) Gets an OpenEMS-Error from its code.int
getCode()
getMessage
(Object... params) Gets the formatted Error message.static OpenemsError
Returns the enum constant of this class with the specified name.static OpenemsError[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
GENERIC
-
COMMON_NO_VALID_CHANNEL_ADDRESS
-
COMMON_USER_NOT_AUTHENTICATED
-
COMMON_ROLE_ACCESS_DENIED
-
COMMON_AUTHENTICATION_FAILED
-
COMMON_USER_UNDEFINED
-
COMMON_ROLE_UNDEFINED
-
EDGE_NO_COMPONENT_WITH_ID
-
EDGE_MULTIPLE_COMPONENTS_WITH_ID
-
EDGE_UNABLE_TO_APPLY_CONFIG
-
EDGE_UNABLE_TO_CREATE_CONFIG
-
EDGE_UNABLE_TO_DELETE_CONFIG
-
EDGE_CHANNEL_NO_OPTION
-
BACKEND_EDGE_NOT_CONNECTED
-
BACKEND_UI_TOKEN_MISSING
-
BACKEND_NO_UI_WITH_TOKEN
-
JSONRPC_ID_NOT_UNIQUE
-
JSONRPC_UNHANDLED_METHOD
-
JSONRPC_INVALID_MESSAGE
-
JSONRPC_RESPONSE_WITHOUT_REQUEST
-
JSON_HAS_NO_MEMBER
-
JSON_NO_INTEGER
-
JSON_NO_INTEGER_MEMBER
-
JSON_NO_OBJECT
-
JSON_NO_OBJECT_MEMBER
-
JSON_NO_PRIMITIVE
-
JSON_NO_PRIMITIVE_MEMBER
-
JSON_NO_ARRAY
-
JSON_NO_ARRAY_MEMBER
-
JSON_NO_DATE_MEMBER
-
JSON_NO_STRING
-
JSON_NO_STRING_MEMBER
-
JSON_NO_BOOLEAN
-
JSON_NO_BOOLEAN_MEMBER
-
JSON_NO_NUMBER
-
JSON_NO_NUMBER_MEMBER
-
JSON_PARSE_ELEMENT_FAILED
-
JSON_PARSE_FAILED
-
JSON_NO_ENUM_MEMBER
-
JSON_NO_INET4ADDRESS
-
JSON_NO_ENUM
-
JSON_NO_FLOAT
-
JSON_NO_FLOAT_MEMBER
-
JSON_NO_SHORT
-
JSON_NO_SHORT_MEMBER
-
JSON_NO_LONG
-
JSON_NO_LONG_MEMBER
-
JSON_NO_DOUBLE
-
JSON_NO_DOUBLE_MEMBER
-
JSON_NO_STRING_ARRAY
-
JSON_NO_INET4ADDRESS_MEMBER
-
JSON_NO_UUID
-
JSON_NO_UUID_MEMBER
-
XML_HAS_NO_MEMBER
-
XML_NO_STRING_MEMBER
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException
- if the argument is null
-
fromCode
Gets an OpenEMS-Error from its code.- Parameters:
code
- the error code- Returns:
- the OpenEMS-Error
- Throws:
OpenemsException
- if no standard exception with this error code exists.
-
getCode
public int getCode() -
getRawMessage
-
getMessage
Gets the formatted Error message.- Parameters:
params
- the error parameters- Returns:
- the error message as String
-
exception
Creates a OpenEMS Named Exception from this Error.Use like: `throw OpenemsError.GENERIC.exception(...)`
- Parameters:
params
- the params for the Error message- Returns:
- OpenemsNamedException
-