use of android.arch.persistence.room.TypeConverter in project bugzy by cpunq.
the class BugzyTypeConverters method caseEventListFromString.
@TypeConverter
public static List<CaseEvent> caseEventListFromString(String value) {
Type listType = new TypeToken<List<CaseEvent>>() {
}.getType();
List<CaseEvent> events = sGson.fromJson(value, listType);
if (events != null) {
Collections.sort(events, ((caseEvent, t1) -> Long.compare(t1.getDate().getTime(), caseEvent.getDate().getTime())));
}
return events;
}
Aggregations