@Test(expected = NoSuchElementException.class) public void testMissingConverter() throws NoSuchMethodException { ParamConverterEngine engine = new ParamConverterEngine(); engine.converters = ImmutableList.<ParameterConverter>of(new MemberConverter()); engine.convertValue("hello", Object.class, null, null); }
@Override public <T> T convertValue(String input, Class<T> rawType, Type type, String defaultValue) throws IllegalArgumentException { if (rawType.isArray()) { List<String> args = getMultipleValues(input, defaultValue); return createArray(args, rawType.getComponentType()); } else if (Collection.class.isAssignableFrom(rawType)) { List<String> args = getMultipleValues(input, defaultValue); return createCollection(args, rawType, type); } else { return convertSingleValue(input, rawType, defaultValue); } }
ParamConverterEngine implements ParameterFactories { @Override public <T> T convertValue(String input, Class<T> rawType, Type type, String defaultValue) throws IllegalArgumentException { if (rawType.isArray()) { List<String> args = getMultipleValues(input, defaultValue); return createArray(args, rawType.getComponentType()); } else if (Collection.class.isAssignableFrom(rawType)) { List<String> args = getMultipleValues(input, defaultValue); return createCollection(args, rawType, type); } else { return convertSingleValue(input, rawType, defaultValue); } } }
ParamConverterEngine implements ParameterFactories { @Override public <T> T convertValue(String input, Class<T> rawType, Type type, String defaultValue) throws IllegalArgumentException { if (rawType.isArray()) { List<String> args = getMultipleValues(input, defaultValue); return createArray(args, rawType.getComponentType()); } else if (Collection.class.isAssignableFrom(rawType)) { List<String> args = getMultipleValues(input, defaultValue); return createCollection(args, rawType, type); } else { return convertSingleValue(input, rawType, defaultValue); } } ParamConverterEngine();  ParamConverterEngine(List<ParameterConverter> conv, List<ParameterFactory> fact); }
ParamConverterEngine implements ParameterFactories { @Override public <T> T convertValue(String input, Class<T> rawType, Type type, String defaultValue) throws IllegalArgumentException { if (rawType.isArray()) { List<String> args = getMultipleValues(input, defaultValue); return createArray(args, rawType.getComponentType()); } else if (Collection.class.isAssignableFrom(rawType)) { List<String> args = getMultipleValues(input, defaultValue); return createCollection(args, rawType, type); } else { return convertSingleValue(input, rawType, defaultValue); } } ParamConverterEngine();  ParamConverterEngine(List<ParameterConverter> conv, List<ParameterFactory> fact); @Override T convertValue(String input, Class<T> rawType, Type type, String defaultValue); @Override T convertValues(Collection<String> input, Class<T> rawType, Type type, String defaultValue); @Override T newInstance(Context context, Class<T> type); @Override Set<Class> getTypesHandledByFactories(); }
ParamConverterEngine implements ParameterFactories { @Override public <T> T convertValue(String input, Class<T> rawType, Type type, String defaultValue) throws IllegalArgumentException { if (rawType.isArray()) { List<String> args = getMultipleValues(input, defaultValue); return createArray(args, rawType.getComponentType()); } else if (Collection.class.isAssignableFrom(rawType)) { List<String> args = getMultipleValues(input, defaultValue); return createCollection(args, rawType, type); } else { return convertSingleValue(input, rawType, defaultValue); } } ParamConverterEngine();  ParamConverterEngine(List<ParameterConverter> conv, List<ParameterFactory> fact); @Override T convertValue(String input, Class<T> rawType, Type type, String defaultValue); @Override T convertValues(Collection<String> input, Class<T> rawType, Type type, String defaultValue); @Override T newInstance(Context context, Class<T> type); @Override Set<Class> getTypesHandledByFactories();  }