net.esper.event
Class MapEventBean

java.lang.Object
  extended by net.esper.event.MapEventBean
All Implemented Interfaces:
EventBean

public class MapEventBean
extends java.lang.Object
implements EventBean

Wrapper for events represented by a Map of key-value pairs that are the event properties. MapEventBean instances are equal if they have the same EventType and all property names and values are reference-equal.


Constructor Summary
  MapEventBean(EventType eventType)
          Constructor for the mutable functions, e.g.
protected MapEventBean(EventType eventType, java.util.Map<java.lang.String,EventBean> events)
          Constructor for initialization with existing values.
protected MapEventBean(java.util.Map<java.lang.String,java.lang.Object> properties, EventType eventType)
          Constructor for initialization with existing values.
 
Method Summary
 boolean equals(java.lang.Object otherObject)
           
 java.lang.Object get(java.lang.String property)
          Returns the value of an event property.
 EventType getEventType()
          Return the EventType instance that describes the set of properties available for this event.
 java.lang.Object getUnderlying()
          Get the underlying data object to this event wrapper.
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MapEventBean

protected MapEventBean(java.util.Map<java.lang.String,java.lang.Object> properties,
                       EventType eventType)
Constructor for initialization with existing values. Makes a shallow copy of the supplied values to not be surprised by changing property values.

Parameters:
properties - are the event property values
eventType - is the type of the event, i.e. describes the map entries

MapEventBean

protected MapEventBean(EventType eventType,
                       java.util.Map<java.lang.String,EventBean> events)
Constructor for initialization with existing values. Makes a shallow copy of the supplied values to not be surprised by changing property values.

Parameters:
eventType - is the type of the event, i.e. describes the map entries
events - are the event property constisting of events

MapEventBean

public MapEventBean(EventType eventType)
Constructor for the mutable functions, e.g. only the type of values is known but not the actual values.

Parameters:
eventType - is the type of the event, i.e. describes the map entries
Method Detail

getEventType

public EventType getEventType()
Description copied from interface: EventBean
Return the EventType instance that describes the set of properties available for this event.

Specified by:
getEventType in interface EventBean
Returns:
event type

get

public java.lang.Object get(java.lang.String property)
                     throws java.lang.IllegalArgumentException,
                            PropertyAccessException
Description copied from interface: EventBean
Returns the value of an event property.

Specified by:
get in interface EventBean
Parameters:
property - - name of the property whose value is to be retrieved
Returns:
the value of a simple property with the specified name.
Throws:
PropertyAccessException - - if there is no property of the specified name, or the property cannot be accessed
java.lang.IllegalArgumentException

getUnderlying

public java.lang.Object getUnderlying()
Description copied from interface: EventBean
Get the underlying data object to this event wrapper.

Specified by:
getUnderlying in interface EventBean
Returns:
underlying data object, usually either a Map or a Java bean instance.

equals

public boolean equals(java.lang.Object otherObject)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object