com.jn.easyjson.jackson.DateSeries Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of easyjson-jackson Show documentation
Show all versions of easyjson-jackson Show documentation
Adapter easyjson to Jackson
package com.jn.easyjson.jackson;
import com.jn.langx.util.collection.Collects;
import com.jn.langx.util.reflect.Reflects;
import java.sql.Timestamp;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.List;
public class DateSeries {
private static List supportedDateTypes = Collects.newArrayList(
Date.class,
java.sql.Date.class,
Timestamp.class,
Calendar.class,
GregorianCalendar.class
);
public static boolean isSupported(Class type) {
return Reflects.isSubClassOrEquals(Date.class, type)
|| Reflects.isSubClassOrEquals(Calendar.class, type)
|| supportedDateTypes.contains(type);
}
}