/** * Converts the specified object to a member of the enumeration. * * @param value * object to convert * @return enumeration member * @throws NullPointerException * if value is {@code null} * @throws IllegalArgumentException * if object cannot be matched to a member of the enumeration */ public static OpCompCode valueOf(Object value) { if (value == null) { throw new NullPointerException("object must be non-null"); } if (value instanceof Number) { return valueOf(((Number) value).intValue()); } else if (value instanceof String) { return valueOf(value.toString()); } throw new IllegalArgumentException( "Cannot convert object of type '" + value.getClass().getName() + "' enum OpCompCode"); } }
jsonString.append(JSON_COMP_CODE_LABEL).append(ATTR_SEP); Utils.quote(activity.getCompCode(), jsonString).append(ATTR_JSON); jsonString.append(JSON_COMP_CODE_NO_LABEL).append(ATTR_SEP).append(activity.getCompCode().ordinal()) .append(ATTR_JSON); jsonString.append(JSON_REASON_CODE_LABEL).append(ATTR_SEP).append(activity.getReasonCode()).append(ATTR_JSON);
jsonString.append(JSON_COMP_CODE_LABEL).append(ATTR_SEP); Utils.quote(event.getOperation().getCompCode(), jsonString).append(ATTR_JSON); jsonString.append(JSON_COMP_CODE_NO_LABEL).append(ATTR_SEP).append(event.getOperation().getCompCode().ordinal()) .append(ATTR_JSON); jsonString.append(JSON_REASON_CODE_LABEL).append(ATTR_SEP).append(event.getOperation().getReasonCode())
sev = getLevel(attValue); } else if (attName.equals(SIM_XML_ATTR_CC)) { cc = OpCompCode.valueOf(attValue); } else if (attName.equals(SIM_XML_ATTR_RC)) { rc = Integer.parseInt(attValue);
cc = OpCompCode.valueOf(attValue); } else if (attName.equals(SIM_XML_ATTR_RC)) { rc = Integer.parseInt(attValue);
rcode = Integer.parseInt(value); } else if (key.equalsIgnoreCase(PARAM_COMP_CODE_LABEL)) { ccode = OpCompCode.valueOf(value); } else if (key.equalsIgnoreCase(PARAM_SEVERITY_LABEL)) { event.getOperation().setSeverity(OpLevel.valueOf(value));