org.jconverter.converter.catalog.string.StringToCalendarConverter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jconverter Show documentation
Show all versions of jconverter Show documentation
A Java framework to categorize and apply conversions between arbitrary objects
The newest version!
package org.jconverter.converter.catalog.string;
import static org.jconverter.converter.TypeDomain.typeDomain;
import java.util.Calendar;
import java.util.Date;
import org.jconverter.JConverter;
import org.jconverter.converter.Converter;
import org.jconverter.converter.TypeDomain;
public class StringToCalendarConverter implements Converter {
@Override
public Calendar apply(String source, TypeDomain target, JConverter context) {
Calendar cal = context.instantiate(Calendar.class);
Date date = new StringToDateConverter().apply(source, typeDomain(Date.class), context);
cal.setTime(date);
return cal;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy