Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.gawst.asyncdb.source.typed;
 
 import  android.database.Cursor;
 import  android.support.annotation.NonNull;
 import  android.support.annotation.Nullable;
 
Interface to handle the transformation from E elements to SQL query selections and from Cursor to E elements.

Parameters:
<E> Type of element read/write from the org.gawst.asyncdb.source.DatabaseSource.
<CURSOR> Wrapper around the raw Cursor read
Author(s):
Created by robUx4 on 11/01/2015.
public interface TypedDatabaseElementHandler<E, CURSOR extends Cursor> {
The where clause that should be used to update/delete the item.

see getItemSelectArgs(Object)

Parameters:
itemToSelect the item about to be selected in the database
Returns:
a String for the whereClause in SQLiteDatabase.update() or SQLiteDatabase.delete()
	@NonNull
	String getItemSelectClause(@Nullable E itemToSelect);

The where arguments that should be used to update/delete the item.

see getItemSelectClause(Object)

Parameters:
itemToSelect the item about to be selected in the database
Returns:
a String array for the whereArgs in SQLiteDatabase.update() or SQLiteDatabase.delete()
	@NonNull
	String[] getItemSelectArgs(@NonNull E itemToSelect);

Use the data in the android.database.Cursor to create a valid item

Parameters:
cursor the Cursor to use
Returns:
The element corresponding to the current Cursor position
Throws:
org.gawst.asyncdb.InvalidDbEntry if the Cursor data cannot be used
	@NonNull
cursorToItem(@NonNull CURSOR cursorthrows InvalidDbEntry;
New to GrepCode? Check out our FAQ X