Parcelable
CalendarEventItem
, CallItem
, ContactItem
, DeviceStateItem
, EmptyItem
, ListItem
, LocationItem
, MessageItem
public class Item extends Object implements Parcelable
Parcelable.ClassLoaderCreator<T extends Object>, Parcelable.ContentsFlags, Parcelable.Creator<T extends Object>, Parcelable.WriteFlags
Modifier and Type | Field | Description |
---|---|---|
static Parcelable.Creator<Item> |
CREATOR |
|
static String |
TIME_CREATED |
The timestamp of when this item is created.
|
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_ELIDE_DUPLICATES, PARCELABLE_WRITE_RETURN_VALUE
Modifier | Constructor | Description |
---|---|---|
|
Item() |
|
|
Item(Bundle itemMap) |
|
protected |
Item(Parcel in) |
Modifier and Type | Method | Description |
---|---|---|
boolean |
containsField(String fieldName) |
Test if current item contains a field
|
int |
describeContents() |
|
Boolean |
getAsBoolean(String fieldName) |
Get the value of a Boolean field in the item.
|
Double |
getAsDouble(String fieldName) |
Get the value of a Double field in the item.
|
Float |
getAsFloat(String fieldName) |
Get the value of a Float field in the item.
|
Integer |
getAsInteger(String fieldName) |
Get the value of a Integer field in the item.
|
Long |
getAsLong(String fieldName) |
Get the value of a Long field in the item.
|
String |
getAsString(String fieldName) |
Get the value of a String field in the item.
|
Bundle |
getBundle() |
|
<TValue> TValue |
getValueByField(String fieldName) |
Get the value of a field in the item.
|
void |
setFieldValue(String fieldName,
boolean value) |
Set a value to a field in the Item
|
void |
setFieldValue(String fieldName,
double value) |
Set a value to a field in the Item
|
void |
setFieldValue(String fieldName,
float value) |
Set a value to a field in the Item
|
void |
setFieldValue(String fieldName,
int value) |
Set a value to a field in the Item
|
void |
setFieldValue(String fieldName,
long value) |
Set a value to a field in the Item
|
void |
setFieldValue(String fieldName,
Parcelable value) |
Set a value to a field in the Item
|
void |
setFieldValue(String fieldName,
String value) |
Set a value to a field in the Item
|
void |
setParcelableArrayListFieldValue(String fieldName,
ArrayList<? extends Parcelable> value) |
Set an ArrayList
|
void |
setStringArrayListFieldValue(String fieldName,
ArrayList<String> value) |
Set an ArrayList
|
String |
toDebugString() |
|
void |
writeToParcel(Parcel out,
int flags) |
public static final String TIME_CREATED
public static final Parcelable.Creator<Item> CREATOR
public Item()
public Item(Bundle itemMap)
protected Item(Parcel in)
public String toDebugString()
public Bundle getBundle()
public <TValue> TValue getValueByField(String fieldName)
TValue
- the type of field valuefieldName
- the name of the fieldpublic String getAsString(String fieldName)
fieldName
- the name of the fieldpublic Boolean getAsBoolean(String fieldName)
fieldName
- the name of the fieldpublic Integer getAsInteger(String fieldName)
fieldName
- the name of the fieldpublic Long getAsLong(String fieldName)
fieldName
- the name of the fieldpublic Double getAsDouble(String fieldName)
fieldName
- the name of the fieldpublic Float getAsFloat(String fieldName)
fieldName
- the name of the fieldpublic void setFieldValue(String fieldName, String value)
fieldName
- the name of the fieldvalue
- the value of the fieldpublic void setFieldValue(String fieldName, boolean value)
fieldName
- the name of the fieldvalue
- the value of the fieldpublic void setFieldValue(String fieldName, int value)
fieldName
- the name of the fieldvalue
- the value of the fieldpublic void setFieldValue(String fieldName, long value)
fieldName
- the name of the fieldvalue
- the value of the fieldpublic void setFieldValue(String fieldName, double value)
fieldName
- the name of the fieldvalue
- the value of the fieldpublic void setFieldValue(String fieldName, float value)
fieldName
- the name of the fieldvalue
- the value of the fieldpublic void setFieldValue(String fieldName, Parcelable value)
fieldName
- the name of the fieldvalue
- the value of the fieldpublic void setStringArrayListFieldValue(String fieldName, ArrayList<String> value)
fieldName
- the name of the fieldvalue
- the value of the fieldpublic void setParcelableArrayListFieldValue(String fieldName, ArrayList<? extends Parcelable> value)
fieldName
- the name of the fieldvalue
- the value of the fieldpublic boolean containsField(String fieldName)
fieldName
- the field name to testpublic void writeToParcel(Parcel out, int flags)
writeToParcel
in interface Parcelable
public int describeContents()
describeContents
in interface Parcelable