All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jconverter.converter.catalog.string.StringToCalendarConverter Maven / Gradle / Ivy

Go to download

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