Code example for GsonBuilder

Methods: create

0
 
	private DepartedFactory() { 
	} 
 
	public static List<? extends Departed> parseJson(String json) {
		Gson gson = g.create();
		return gson.fromJson(json, COLLECTION_TYPE);
	} 
 
	public static ContentValues asContentValues(Departed departed) {
		ContentValues values = new ContentValues();
		values.put(_ID, departed.getId());
		values.put(COLUMN_DATE_BIRTH,
				departed.getBirthDate() != null ? departed.getBirthDate()
						.getTime() : null); 
		values.put(COLUMN_DATE_BURIAL,
				departed.getBurialDate() != null ? departed.getBurialDate()
						.getTime() : null); 
		values.put(COLUMN_DATE_DEATH,
				departed.getDeathDate() != null ? departed.getDeathDate()
Experience pair programming with AI  Get Codota for Java