@Test public void shouldBeAbleToConvertNumbers() { assertThat((Character) converter.convert("r", char.class, bundle), is(equalTo('r'))); }
public Character convert(String value, Class<? extends Character> type, ResourceBundle bundle) { if (isNullOrEmpty(value)) { return '\u0000'; } if (value.length() != 1) { throw new ConversionError(MessageFormat.format(bundle.getString("is_not_a_valid_character"), value)); } return value.charAt(0); }
PrimitiveCharConverter implements Converter<Character> { public Character convert(String value, Class<? extends Character> type, ResourceBundle bundle) { if (isNullOrEmpty(value)) { return '\u0000'; } if (value.length() != 1) { throw new ConversionError(MessageFormat.format(bundle.getString("is_not_a_valid_character"), value)); } return value.charAt(0); } }
PrimitiveCharConverter implements Converter<Character> { public Character convert(String value, Class<? extends Character> type, ResourceBundle bundle) { if (isNullOrEmpty(value)) { return '\u0000'; } if (value.length() != 1) { throw new ConversionError(MessageFormat.format(bundle.getString("is_not_a_valid_character"), value)); } return value.charAt(0); }  }
PrimitiveCharConverter implements Converter<Character> { public Character convert(String value, Class<? extends Character> type, ResourceBundle bundle) { if (isNullOrEmpty(value)) { return '\u0000'; } if (value.length() != 1) { throw new ConversionError(MessageFormat.format(bundle.getString("is_not_a_valid_character"), value)); } return value.charAt(0); }  Character convert(String value, Class<? extends Character> type, ResourceBundle bundle); }
PrimitiveCharConverter implements Converter<Character> { public Character convert(String value, Class<? extends Character> type, ResourceBundle bundle) { if (isNullOrEmpty(value)) { return '\u0000'; } if (value.length() != 1) { throw new ConversionError(MessageFormat.format(bundle.getString("is_not_a_valid_character"), value)); } return value.charAt(0); }  Character convert(String value, Class<? extends Character> type, ResourceBundle bundle);  }