@Test public void shouldBeAbleToConvertNull() { assertThat(converter.convert(null, LocalDateTime.class, bundle), is(nullValue())); }
public LocalDateTime convert(String value, Class<? extends LocalDateTime> type, ResourceBundle bundle) { try { DateTime out = new LocaleBasedJodaTimeConverter(localization).convert(value, shortDateTime()); if (out == null) { return null; } return out.toLocalDateTime(); } catch (Exception e) { throw new ConversionError(MessageFormat.format(bundle.getString("is_not_a_valid_datetime"), value)); } }
LocalDateTimeConverter implements Converter<LocalDateTime> { public LocalDateTime convert(String value, Class<? extends LocalDateTime> type, ResourceBundle bundle) { try { DateTime out = new LocaleBasedJodaTimeConverter(localization).convert(value, shortDateTime()); if (out == null) { return null; } return out.toLocalDateTime(); } catch (Exception e) { throw new ConversionError(MessageFormat.format(bundle.getString("is_not_a_valid_datetime"), value)); } } }
LocalDateTimeConverter implements Converter<LocalDateTime> { public LocalDateTime convert(String value, Class<? extends LocalDateTime> type, ResourceBundle bundle) { try { DateTime out = new LocaleBasedJodaTimeConverter(localization).convert(value, shortDateTime()); if (out == null) { return null; } return out.toLocalDateTime(); } catch (Exception e) { throw new ConversionError(MessageFormat.format(bundle.getString("is_not_a_valid_datetime"), value)); } } LocalDateTimeConverter(Localization localization); }
LocalDateTimeConverter implements Converter<LocalDateTime> { public LocalDateTime convert(String value, Class<? extends LocalDateTime> type, ResourceBundle bundle) { try { DateTime out = new LocaleBasedJodaTimeConverter(localization).convert(value, shortDateTime()); if (out == null) { return null; } return out.toLocalDateTime(); } catch (Exception e) { throw new ConversionError(MessageFormat.format(bundle.getString("is_not_a_valid_datetime"), value)); } } LocalDateTimeConverter(Localization localization); LocalDateTime convert(String value, Class<? extends LocalDateTime> type, ResourceBundle bundle); }
LocalDateTimeConverter implements Converter<LocalDateTime> { public LocalDateTime convert(String value, Class<? extends LocalDateTime> type, ResourceBundle bundle) { try { DateTime out = new LocaleBasedJodaTimeConverter(localization).convert(value, shortDateTime()); if (out == null) { return null; } return out.toLocalDateTime(); } catch (Exception e) { throw new ConversionError(MessageFormat.format(bundle.getString("is_not_a_valid_datetime"), value)); } } LocalDateTimeConverter(Localization localization); LocalDateTime convert(String value, Class<? extends LocalDateTime> type, ResourceBundle bundle);  }