} else if (type.isAssignableFrom(Collection.class) || type.isAssignableFrom(List.class)) {
throw new IllegalArgumentException("type not supported:" + type.getName());
} else if (type.isAssignableFrom(Pattern.class)) {
return Pattern.compile(value.toString());
} else if (type.isAssignableFrom(Category.class)) {
return new Category(value.toString());
} else {
// if (type.isEnum()) {
// // is sufficient for our use case where toString returns enum name
// for (T enumConstant : type.getEnumConstants()) {
// if (enumConstant.toString().equalsIgnoreCase(value.toString())) {