public ContentValues getContentValues() { ContentValues values = new ContentValues(); values.put(UUID, uuid); values.put(NAME, name); values.put(CONTACT, contactUuid); values.put(ACCOUNT, accountUuid); values.put(CONTACTJID, contactJid.toString()); values.put(CREATED, created); values.put(STATUS, status); values.put(MODE, mode); values.put(ATTRIBUTES, attributes.toString()); return values; }
public static Conversation fromCursor(Cursor cursor) { Jid jid; try { jid = Jid.fromString(cursor.getString(cursor.getColumnIndex(CONTACTJID)), true); } catch (final InvalidJidException e) { // Borked DB.. jid = null; } return new Conversation( cursor.getString(cursor.getColumnIndex(UUID)), cursor.getString(cursor.getColumnIndex(NAME)), cursor.getString(cursor.getColumnIndex(CONTACT)), cursor.getString(cursor.getColumnIndex(ACCOUNT)), jid, cursor.getLong(cursor.getColumnIndex(CREATED)), cursor.getInt(cursor.getColumnIndex(STATUS)), cursor.getInt(cursor.getColumnIndex(MODE)), cursor.getString(cursor.getColumnIndex(ATTRIBUTES))); }