@Test public void testConvertToPresentation_null_shouldReturnEmptyString() { String presentation = new JodaLocalDateToStringConverter().convertToPresentation(null, String.class, null); assertNotNull(presentation); assertThat(presentation, is("")); }
@CheckForNull @Override public String convertToPresentation(@CheckForNull LocalDate value, @CheckForNull Class<? extends String> targetType, @CheckForNull Locale locale) throws Converter.ConversionException { if (value == null) { return ""; } return getFormat(getNullsafeLocale(locale)).print(value); }
JodaLocalDateToStringConverter implements Converter<String, LocalDate> { @CheckForNull @Override public String convertToPresentation(@CheckForNull LocalDate value, @CheckForNull Class<? extends String> targetType, @CheckForNull Locale locale) throws Converter.ConversionException { if (value == null) { return ""; } return getFormat(getNullsafeLocale(locale)).print(value); } }
JodaLocalDateToStringConverter implements Converter<String, LocalDate> { @CheckForNull @Override public String convertToPresentation(@CheckForNull LocalDate value, @CheckForNull Class<? extends String> targetType, @CheckForNull Locale locale) throws Converter.ConversionException { if (value == null) { return ""; } return getFormat(getNullsafeLocale(locale)).print(value); }  }
JodaLocalDateToStringConverter implements Converter<String, LocalDate> { @CheckForNull @Override public String convertToPresentation(@CheckForNull LocalDate value, @CheckForNull Class<? extends String> targetType, @CheckForNull Locale locale) throws Converter.ConversionException { if (value == null) { return ""; } return getFormat(getNullsafeLocale(locale)).print(value); }  @CheckForNull @Override LocalDate convertToModel(@CheckForNull String value,
            @CheckForNull Class<? extends LocalDate> targetType,
            @CheckForNull Locale locale); @CheckForNull @Override String convertToPresentation(@CheckForNull LocalDate value,
            @CheckForNull Class<? extends String> targetType,
            @CheckForNull Locale locale); static DateTimeFormatter getFormat(Locale locale); @Override Class<LocalDate> getModelType(); @Override Class<String> getPresentationType(); }
JodaLocalDateToStringConverter implements Converter<String, LocalDate> { @CheckForNull @Override public String convertToPresentation(@CheckForNull LocalDate value, @CheckForNull Class<? extends String> targetType, @CheckForNull Locale locale) throws Converter.ConversionException { if (value == null) { return ""; } return getFormat(getNullsafeLocale(locale)).print(value); }  @CheckForNull @Override LocalDate convertToModel(@CheckForNull String value,
            @CheckForNull Class<? extends LocalDate> targetType,
            @CheckForNull Locale locale); @CheckForNull @Override String convertToPresentation(@CheckForNull LocalDate value,
            @CheckForNull Class<? extends String> targetType,
            @CheckForNull Locale locale); static DateTimeFormatter getFormat(Locale locale); @Override Class<LocalDate> getModelType(); @Override Class<String> getPresentationType();  }