private boolean validate(ActionReport actionReport) { boolean result = false; if (value != null) { try { int thresholdValue = Integer.parseInt(value); if (thresholdValue <= 0 || thresholdValue > Short.MAX_VALUE * 2) { actionReport.failure( logger, "Threshold Value must be greater than zero or less than " + Short.MAX_VALUE * 2 + 1); return result; } } catch (NumberFormatException nfe) { actionReport.failure(logger, "Threshold Value is not a valid integer", nfe); return result; } } if (unit != null) { try { if (!unit.equals("NANOSECONDS") && !unit.equals("MICROSECONDS") && !unit.equals("MILLISECONDS") && !unit.equals("SECONDS") && !unit.equals("MINUTES") && !unit.equals("HOURS") && !unit.equals("DAYS")) { actionReport.failure(logger, unit + " is an invalid time unit"); return result; } } catch (IllegalArgumentException iaf) { actionReport.failure(logger, unit + " is an invalid time unit", iaf); return result; } } return true; }