return ((Number)value).intValue();
} else if (value instanceof String) {
try {
return Integer.parseInt((String)value);
} catch (NumberFormatException e) {
throw new IllegalParameterException("Illegal type for " + parameter + " setting - use an integer");
}
} else {
throw new IllegalParameterException("Illegal type for " + parameter + " setting - use an integer");
}
}