org.simpleflatmapper.converter.joda.impl.CharSequenceToJodaDateTimeConverter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sfm-converter-joda-time Show documentation
Show all versions of sfm-converter-joda-time Show documentation
Java library to map flat record - ResultSet, csv - to java object with minimum configuration and low footprint.
package org.simpleflatmapper.converter.joda.impl;
import org.joda.time.DateTime;
import org.joda.time.format.DateTimeFormatter;
import org.simpleflatmapper.converter.Converter;
public class CharSequenceToJodaDateTimeConverter implements Converter {
private final DateTimeFormatter dateTimeFormatter;
public CharSequenceToJodaDateTimeConverter(DateTimeFormatter dateTimeFormatter) {
this.dateTimeFormatter = dateTimeFormatter;
}
@Override
public DateTime convert(CharSequence in) throws Exception {
if (in == null || in.length() == 0) return null;
return dateTimeFormatter.parseDateTime(String.valueOf(in));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy