@Test public void convertsIntegerValues() { assertThat(converter.convert("9000", Integer.TYPE), is(9000)); }
@Override public <T> T convert(Object source, Class<T> targetType) { if (source == null) { return null; } if (targetType == Boolean.class || targetType == Boolean.TYPE) { @SuppressWarnings("unchecked") T t = (T) Boolean.valueOf(source.toString()); return t; } @SuppressWarnings("unchecked") T t = (T) parse(source.toString(), targetType); return t; }
SimpleConverter implements Converter { @Override public <T> T convert(Object source, Class<T> targetType) { if (source == null) { return null; } if (targetType == Boolean.class || targetType == Boolean.TYPE) { @SuppressWarnings("unchecked") T t = (T) Boolean.valueOf(source.toString()); return t; } @SuppressWarnings("unchecked") T t = (T) parse(source.toString(), targetType); return t; } }
SimpleConverter implements Converter { @Override public <T> T convert(Object source, Class<T> targetType) { if (source == null) { return null; } if (targetType == Boolean.class || targetType == Boolean.TYPE) { @SuppressWarnings("unchecked") T t = (T) Boolean.valueOf(source.toString()); return t; } @SuppressWarnings("unchecked") T t = (T) parse(source.toString(), targetType); return t; }  }
SimpleConverter implements Converter { @Override public <T> T convert(Object source, Class<T> targetType) { if (source == null) { return null; } if (targetType == Boolean.class || targetType == Boolean.TYPE) { @SuppressWarnings("unchecked") T t = (T) Boolean.valueOf(source.toString()); return t; } @SuppressWarnings("unchecked") T t = (T) parse(source.toString(), targetType); return t; }  @Override T convert(Object source, Class<T> targetType); }
SimpleConverter implements Converter { @Override public <T> T convert(Object source, Class<T> targetType) { if (source == null) { return null; } if (targetType == Boolean.class || targetType == Boolean.TYPE) { @SuppressWarnings("unchecked") T t = (T) Boolean.valueOf(source.toString()); return t; } @SuppressWarnings("unchecked") T t = (T) parse(source.toString(), targetType); return t; }  @Override T convert(Object source, Class<T> targetType);  }