package org.iotivity.service.ns.common;
-public enum NSErrorCode
-{
+/**
+ *
+ * This enum provides details of error code messages thrown in NSException.
+ *
+ */
+public enum NSErrorCode {
OK("OK", ""),
ERROR("ERROR", ""),
SUCCESS("SUCCESS", ""),
ALLOW("ALLOW", ""),
DENY("DENY", ""),
JNI_EXCEPTION("JNI_EXCEPTION", "Generic Java binder error"),
- JNI_NO_NATIVE_OBJECT("JNI_NO_NATIVE_OBJECT", ""),
- JNI_INVALID_VALUE("JNI_INVALID_VALUE", ""),;
+ JNI_NO_NATIVE_OBJECT("JNI_NO_NATIVE_POINTER", ""),
+ JNI_INVALID_VALUE("JNI_INVALID_VALUE", ""),
+ NATIVE_EXCEPTION("NATIVE_EXCEPTION", "");
private String error;
private String description;
- private NSErrorCode(String error, String description)
-{
- this.error = error;
- this.description = description;
-}
+ private NSErrorCode(String error, String description) {
+ this.error = error;
+ this.description = description;
+ }
-public String getError()
-{
- return error;
-}
+ public String getError() {
+ return error;
+ }
-public String getDescription()
-{
- return description;
-}
+ public String getDescription() {
+ return description;
+ }
-public static NSErrorCode get(String errorCode)
-{
- for (NSErrorCode eCode : NSErrorCode.values())
- {
- if (eCode.getError().equals(errorCode))
- {
- return eCode;
+ public static NSErrorCode get(String errorCode) {
+ for (NSErrorCode eCode : NSErrorCode.values()) {
+ if (eCode.getError().equals(errorCode)) {
+ return eCode;
+ }
}
+ throw new IllegalArgumentException("Unexpected NSErrorCode value");
}
- throw new IllegalArgumentException("Unexpected NSErrorCode value");
-}
-@Override
-public String toString()
-{
- return error + (description.isEmpty() ? "" : " : " + description);
+ @Override
+ public String toString() {
+ return error + (description.isEmpty() ? "" : " : " + description);
+ }
}
-}
\ No newline at end of file