boolean (Object component, String key, String value, String[] values, String defaultvalue) { if (value == null) { return set(component, key, defaultvalue); } for (int i = 0; i < values.length; i++) { if (value.equals(values[i])) { return set(component, key, values[i]); } } throw new IllegalArgumentException("unknown " + value + " for " + key); }