@PSItem public class Item extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static Item |
EOS |
static java.lang.String |
TIME_CREATED
The timestamp of when this item is created.
|
Constructor and Description |
---|
Item() |
Item(java.util.Map<java.lang.String,java.lang.Object> itemMap) |
Modifier and Type | Method and Description |
---|---|
boolean |
containsField(java.lang.String fieldName)
Test if current item contains a field
|
boolean |
equals(Item anotherItem) |
void |
excludeFields(java.lang.String... fieldKeys)
Exclude some fields from current item
the excluded fields will not be available for output
|
java.lang.Boolean |
getAsBoolean(java.lang.String fieldName)
Get the value of a Boolean field in the item.
|
java.lang.Double |
getAsDouble(java.lang.String fieldName)
Get the value of a Double field in the item.
|
java.lang.Float |
getAsFloat(java.lang.String fieldName)
Get the value of a Float field in the item.
|
java.lang.Integer |
getAsInteger(java.lang.String fieldName)
Get the value of a Integer field in the item.
|
java.lang.Long |
getAsLong(java.lang.String fieldName)
Get the value of a Long field in the item.
|
java.lang.String |
getAsString(java.lang.String fieldName)
Get the value of a String field in the item.
|
<TValue> TValue |
getValueByField(java.lang.String fieldName)
Get the value of a field in the item.
|
void |
includeFields(java.lang.String... fieldKeys)
Include certain fields for output
the included fields will be available for output, while other fields will not
|
boolean |
isEndOfStream() |
<TValue> void |
setFieldValue(java.lang.String fieldName,
TValue value)
Set a value to a field in the item
|
java.lang.String |
toDebugString() |
org.json.JSONObject |
toJson() |
java.util.Map<java.lang.String,java.lang.Object> |
toMap() |
java.lang.String |
toString() |
@PSItemField(type=java.lang.Long.class) public static final java.lang.String TIME_CREATED
public static final Item EOS
public Item()
public Item(java.util.Map<java.lang.String,java.lang.Object> itemMap)
public boolean isEndOfStream()
public java.util.Map<java.lang.String,java.lang.Object> toMap()
public org.json.JSONObject toJson()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toDebugString()
public <TValue> TValue getValueByField(java.lang.String fieldName)
TValue
- the type of field valuefieldName
- the name of the fieldpublic java.lang.String getAsString(java.lang.String fieldName)
fieldName
- the name of the fieldpublic java.lang.Boolean getAsBoolean(java.lang.String fieldName)
fieldName
- the name of the fieldpublic java.lang.Integer getAsInteger(java.lang.String fieldName)
fieldName
- the name of the fieldpublic java.lang.Long getAsLong(java.lang.String fieldName)
fieldName
- the name of the fieldpublic java.lang.Double getAsDouble(java.lang.String fieldName)
fieldName
- the name of the fieldpublic java.lang.Float getAsFloat(java.lang.String fieldName)
fieldName
- the name of the fieldpublic <TValue> void setFieldValue(java.lang.String fieldName, TValue value)
TValue
- the type of field valuefieldName
- the name of fieldvalue
- the value of fieldpublic boolean containsField(java.lang.String fieldName)
fieldName
- the field name to testpublic void includeFields(java.lang.String... fieldKeys)
fieldKeys
- the names of fields to includepublic void excludeFields(java.lang.String... fieldKeys)
fieldKeys
- the names of fields to excludepublic boolean equals(Item anotherItem)