use of android.arch.persistence.room.TypeConverter in project IITB-App by wncc.
the class Converters method stringfromEvents.
@TypeConverter
public static String stringfromEvents(List<Event> list) {
Gson gson = new Gson();
String json = gson.toJson(list);
return json;
}
use of android.arch.persistence.room.TypeConverter in project IITB-App by wncc.
the class Converters method stringfromVenues.
@TypeConverter
public static String stringfromVenues(List<Venue> list) {
Gson gson = new Gson();
String json = gson.toJson(list);
return json;
}
use of android.arch.persistence.room.TypeConverter in project IITB-App by wncc.
the class Converters method stringfromUsers.
@TypeConverter
public static String stringfromUsers(List<User> list) {
Gson gson = new Gson();
String json = gson.toJson(list);
return json;
}
use of android.arch.persistence.room.TypeConverter in project IITB-App by wncc.
the class Converters method stringfromTimestamp.
@TypeConverter
public static String stringfromTimestamp(Timestamp timestamp) {
Gson gson = new Gson();
String json = gson.toJson(timestamp);
return json;
}
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