com.ibm.sensorevent.model
Class Payload

java.lang.Object
  extended by com.ibm.sensorevent.model.generic.GenericGroup
      extended by com.ibm.sensorevent.model.Group
          extended by com.ibm.sensorevent.model.Payload
All Implemented Interfaces:
IGenericGroup, IGroup, IPayload, java.io.Serializable
Direct Known Subclasses:
IBMSensorEventPayload

public class Payload
extends Group
implements IPayload

Payload represents one of the three main groups within an IBMSensorEvent.

Since a Payload is a Group, Payload may contain attributes and subgroups.

The interface associated with this class is IPayload.

See Also:
Serialized Form

Field Summary
static java.lang.String COPYRIGHT
           
protected  java.lang.String payloadClassName
          The full class name of this payload instance.
 
Fields inherited from class com.ibm.sensorevent.model.generic.GenericGroup
attributes, groups, name
 
Constructor Summary
protected Payload()
          Constructs a Payload
 
Method Summary
 void copyFields(IPayload sourcePayload)
          Copies the fields unique to this class (such as payload class name) from the source payload into this payload
static void copyGroup(IGenericGroup sourceGroup, IGenericGroup targetGroup)
          Copies the attributes and subgroups from the source group into the target group
static IGenericGroup getInstance()
          Factory method to create an empty Payload
static IGenericGroup getInstance(IPayload sourcePayload)
          Factory method to create an IPayload from the specified payload
 java.lang.String getPayloadClassName()
          Returns the payload's class name
 void setPayloadClassName(java.lang.String s)
          Sets the payload's class name
 java.lang.String toString()
          Returns a string representation of this payload (for debug purposes)
 
Methods inherited from class com.ibm.sensorevent.model.Group
fromMap, fromTypedMap, getInstance, processGroup, processMap, processTypedGroup, processTypedMap, toMap, toTypedMap
 
Methods inherited from class com.ibm.sensorevent.model.generic.GenericGroup
addAttribute, addAttributeArray, addBooleanArrayAttribute, addBooleanAttribute, addByteArrayAttribute, addByteAttribute, addDateArrayAttribute, addDateArrayAttributeAsLong, addDateAttribute, addDateAttributeAsLong, addDoubleArrayAttribute, addDoubleAttribute, addFloatArrayAttribute, addFloatAttribute, addGroup, addHexAttribute, addHexAttribute, addIntArrayAttribute, addIntAttribute, addLongArrayAttribute, addLongAttribute, addShortArrayAttribute, addShortAttribute, addStringArrayAttribute, addStringAttribute, createGroupPath, getAttribute, getAttributes, getAttributesAsList, getBooleanAttributeArrayValue, getBooleanAttributeValue, getByteAttributeArrayValue, getByteAttributeValue, getDateAttributeArrayValue, getDateAttributeArrayValueAsLong, getDateAttributeValue, getDateAttributeValueAsLong, getDoubleAttributeArrayValue, getDoubleAttributeValue, getFloatAttributeArrayValue, getFloatAttributeValue, getGroup, getGroups, getGroupsAsList, getHexAttributeValue, getHexAttributeValueAsString, getIntAttributeArrayValue, getIntAttributeValue, getLongAttributeArrayValue, getLongAttributeValue, getName, getShortAttributeArrayValue, getShortAttributeValue, getStringAttributeArrayValue, getStringAttributeValue, removeAttributes, removeGroups, setAttributes, setGroups, setName, traverseGroupPath
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.ibm.sensorevent.model.IGroup
toMap, toTypedMap
 
Methods inherited from interface com.ibm.sensorevent.model.generic.IGenericGroup
addAttribute, addAttributeArray, addBooleanArrayAttribute, addBooleanAttribute, addByteArrayAttribute, addByteAttribute, addDateArrayAttribute, addDateArrayAttributeAsLong, addDateAttribute, addDateAttributeAsLong, addDoubleArrayAttribute, addDoubleAttribute, addFloatArrayAttribute, addFloatAttribute, addGroup, addHexAttribute, addHexAttribute, addIntArrayAttribute, addIntAttribute, addLongArrayAttribute, addLongAttribute, addShortArrayAttribute, addShortAttribute, addStringArrayAttribute, addStringAttribute, createGroupPath, getAttribute, getAttributes, getAttributesAsList, getBooleanAttributeArrayValue, getBooleanAttributeValue, getByteAttributeArrayValue, getByteAttributeValue, getDateAttributeArrayValue, getDateAttributeArrayValueAsLong, getDateAttributeValue, getDateAttributeValueAsLong, getDoubleAttributeArrayValue, getDoubleAttributeValue, getFloatAttributeArrayValue, getFloatAttributeValue, getGroup, getGroups, getGroupsAsList, getHexAttributeValue, getHexAttributeValueAsString, getIntAttributeArrayValue, getIntAttributeValue, getLongAttributeArrayValue, getLongAttributeValue, getName, getShortAttributeArrayValue, getShortAttributeValue, getStringAttributeArrayValue, getStringAttributeValue, removeAttributes, removeGroups, setAttributes, setGroups, setName, traverseGroupPath
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
See Also:
Constant Field Values

payloadClassName

protected volatile java.lang.String payloadClassName
The full class name of this payload instance. Since the actual instance is a subclass of Payload, this field holds the class name so the instance can be correctly created when calling getPayload.

Constructor Detail

Payload

protected Payload()
           throws SensorEventException
Constructs a Payload

Throws:
SensorEventException
Method Detail

getInstance

public static IGenericGroup getInstance()
                                 throws SensorEventException
Factory method to create an empty Payload

Throws:
SensorEventException

getInstance

public static IGenericGroup getInstance(IPayload sourcePayload)
                                 throws SensorEventException
Factory method to create an IPayload from the specified payload

Parameters:
sourcePayload - the payload to copy from
Throws:
SensorEventException

copyGroup

public static void copyGroup(IGenericGroup sourceGroup,
                             IGenericGroup targetGroup)
                      throws SensorEventException
Copies the attributes and subgroups from the source group into the target group

Parameters:
sourceGroup - the source group
targetGroup - the target group
Throws:
SensorEventException

getPayloadClassName

public java.lang.String getPayloadClassName()
                                     throws SensorEventException
Returns the payload's class name

Specified by:
getPayloadClassName in interface IPayload
Throws:
SensorEventException

setPayloadClassName

public void setPayloadClassName(java.lang.String s)
                         throws SensorEventException
Sets the payload's class name

Specified by:
setPayloadClassName in interface IPayload
Throws:
SensorEventException

copyFields

public void copyFields(IPayload sourcePayload)
                throws SensorEventException
Copies the fields unique to this class (such as payload class name) from the source payload into this payload

Specified by:
copyFields in interface IPayload
Parameters:
sourcePayload - the source payload
Throws:
SensorEventException

toString

public java.lang.String toString()
Returns a string representation of this payload (for debug purposes)

Overrides:
toString in class GenericGroup


Copyright © 2005 - 2009 IBM Corp. All Rights Reserved.