com.vodafone360.people.database.utils
Class SqlUtils

java.lang.Object
  extended by com.vodafone360.people.database.utils.SqlUtils

public final class SqlUtils
extends java.lang.Object

SQLite utility methods.


Constructor Summary
private SqlUtils()
          Private constructor to prevent instantiation.
 
Method Summary
static ActivityItem.Type setActivityItemType(Cursor cursor, java.lang.String field)
          Return the value of the given field, or NULL if the value is not present.
static byte[] setBlob(Cursor cursor, java.lang.String field)
          Return the value of the given field, or NULL if the value is not present.
static java.lang.Boolean setBoolean(Cursor cursor, java.lang.String field, java.lang.Boolean defaultValue)
          Return the value of the given field, or defaultValue if the value is not present.
static java.lang.Integer setInt(Cursor cursor, java.lang.String field, java.lang.Integer defaultValue)
          Return the value of the given field, or NULL if the value is not present.
static java.lang.Long setLong(Cursor cursor, java.lang.String field, java.lang.Long defaultValue)
          Return the value of the given field, or NULL if the value is not present.
static java.lang.String setString(Cursor cursor, java.lang.String field)
          Return the value of the given field, or NULL if the value is not present.
static ActivitiesTable.TimelineSummaryItem.Type setTimelineSummaryItemType(Cursor cursor, java.lang.String field)
          Return the value of the given field, or NULL if the value is not present.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SqlUtils

private SqlUtils()
Private constructor to prevent instantiation.

Method Detail

setLong

public static java.lang.Long setLong(Cursor cursor,
                                     java.lang.String field,
                                     java.lang.Long defaultValue)
Return the value of the given field, or NULL if the value is not present.

Parameters:
cursor - SQLite cursor.
field - Column identifier.
defaultValue - Value returned if value not found in Cursor.
Returns:
Value or NULL if not present.

setString

public static java.lang.String setString(Cursor cursor,
                                         java.lang.String field)
Return the value of the given field, or NULL if the value is not present.

Parameters:
cursor - SQLite cursor.
field - Column identifier.
Returns:
Value or NULL if not present.

setInt

public static java.lang.Integer setInt(Cursor cursor,
                                       java.lang.String field,
                                       java.lang.Integer defaultValue)
Return the value of the given field, or NULL if the value is not present.

Parameters:
cursor - SQLite cursor.
field - Column identifier.
defaultValue - Value returned if value not found in Cursor.
Returns:
Value or NULL if not present.

setBoolean

public static java.lang.Boolean setBoolean(Cursor cursor,
                                           java.lang.String field,
                                           java.lang.Boolean defaultValue)
Return the value of the given field, or defaultValue if the value is not present.

Parameters:
cursor - SQLite cursor.
field - Column identifier.
defaultValue - Value returned if value not found in Cursor.
Returns:
Value or NULL if not present.

setActivityItemType

public static ActivityItem.Type setActivityItemType(Cursor cursor,
                                                    java.lang.String field)
Return the value of the given field, or NULL if the value is not present.

Parameters:
cursor - SQLite cursor.
field - Column identifier.
Returns:
Value or NULL if not present.

setTimelineSummaryItemType

public static ActivitiesTable.TimelineSummaryItem.Type setTimelineSummaryItemType(Cursor cursor,
                                                                                  java.lang.String field)
Return the value of the given field, or NULL if the value is not present.

Parameters:
cursor - SQLite cursor.
field - Column identifier.
Returns:
Value or NULL if not present.

setBlob

public static byte[] setBlob(Cursor cursor,
                             java.lang.String field)
Return the value of the given field, or NULL if the value is not present.

Parameters:
cursor - SQLite cursor.
field - Column identifier.
Returns:
Value or NULL if not present.


JavaDoc