private ConditionCode(int code, String description) { this.code = code; this.description = description; Object old = ConditionCode.LOOKUP.put(new Integer(code), this); if (old != null) { throw new RuntimeException("Duplicate condition code!"); } }
/** * Returns a condition code instance for a given integer * * @param code integer code to search for * @return a ConditionCode instance or null */ public static ConditionCode fromCode(int code) { return (ConditionCode) ConditionCode.LOOKUP.get(new Integer(code)); }