Esempio n. 1
0
 @Override
 public ConnectionProfile cursorToObject(Cursor cursor) {
   final ConnectionProfile profile = new ConnectionProfile();
   profile.setId(cursor.getLong(columnIds.get(COL_ID)));
   profile.setName(cursor.getString(columnIds.get(COL_NAME)));
   profile.setHostname(cursor.getString(columnIds.get(COL_HOSTNAME)));
   profile.setPort(cursor.getInt(columnIds.get(COL_PORT)));
   profile.setPassword(cursor.getString(columnIds.get(COL_PASSWORD)));
   profile.setStreamingHostname(cursor.getString(columnIds.get(COL_STREAMING_HOSTNAME)));
   profile.setStreamingPort(cursor.getInt(columnIds.get(COL_STREAMING_PORT)));
   profile.setStreamingSuffix(cursor.getString(columnIds.get(COL_STREAMING_SUFFIX)));
   profile.setMusicPath(cursor.getString(columnIds.get(COL_MUSIC_PATH)));
   profile.setCoverFilename(cursor.getString(columnIds.get(COL_COVER_FILENAME)));
   profile.setUseDatabaseCache(cursor.getInt(columnIds.get(COL_USE_DATABASE_CACHE)) > 0);
   return profile;
 }
Esempio n. 2
0
 @Override
 public ContentValues objectToContentValues(ConnectionProfile object) {
   final ContentValues content = new ContentValues();
   content.put(COL_ID, object.getId());
   content.put(COL_NAME, object.getName());
   content.put(COL_HOSTNAME, object.getHostname());
   content.put(COL_PORT, object.getPort());
   content.put(COL_PASSWORD, object.getPassword());
   content.put(COL_STREAMING_HOSTNAME, object.getStreamingHostname());
   content.put(COL_STREAMING_PORT, object.getStreamingPort());
   content.put(COL_STREAMING_SUFFIX, object.getStreamingSuffix());
   content.put(COL_MUSIC_PATH, object.getMusicPath());
   content.put(COL_COVER_FILENAME, object.getCoverFilename());
   content.put(COL_USE_DATABASE_CACHE, object.usesDatabaseCache() ? 1 : 0);
   return content;
 }