/** * This method converts the encapsulated date type to a string, respecting * any locales and conversion patterns that have been set through opencsv * annotations. * * @param value The object containing a date of one of the supported types * @return A string representation of the date. If a * {@link CsvBindByName#locale() locale} or {@link CsvDate#value() conversion * pattern} has been specified through annotations, these are used when * creating the return value. * @throws CsvDataTypeMismatchException If an unsupported type as been * improperly annotated */ @Override public String convertToWrite(Object value) throws CsvDataTypeMismatchException { return value == null ? null : convertCommon(value, String.class); } }
@Override public Object convertToRead(String value) throws CsvDataTypeMismatchException { return StringUtils.isBlank(value) ? null : convertCommon(value, type); }