Skip to content

Instantly share code, notes, and snippets.

@ericwoodruff
Last active December 28, 2015 20:28
Show Gist options
  • Save ericwoodruff/7557068 to your computer and use it in GitHub Desktop.
Save ericwoodruff/7557068 to your computer and use it in GitHub Desktop.
toContentValues example
public static ContentValues toContentValues (User user) {
ContentValues values = new ContentValues ();
switch (Column._id) {
case _id: // auto-incremented primary key, skip this one
case sync_state: values.put (Column.sync_state.name (), user.getSyncState ());
case user_id: values.put (Column.user_id.name (), user.getUserId ());
}
return values;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment