com.grosner.dbflow.converter.CalendarConverter Maven / Gradle / Ivy
package com.grosner.dbflow.converter;
import java.util.Calendar;
/**
* Author: andrewgrosner
* Description: Defines how we store and retrieve a {@link java.util.Calendar}
*/
public class CalendarConverter extends TypeConverter {
@Override
public Long getDBValue(Calendar model) {
return model.getTimeInMillis();
}
@Override
public Calendar getModelValue(Long data) {
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(data);
return calendar;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy