net.esper.event
Class BeanEventBean

java.lang.Object
  extended by net.esper.event.BeanEventBean
All Implemented Interfaces:
EventBean, EventBeanSPI

public class BeanEventBean
extends Object
implements EventBeanSPI

Wrapper for Java bean (POJO or regular) Java objects the represent events. Allows access to event properties, which is done through the getter supplied by the event type. EventType instances containing type information are obtained from BeanEventAdapter. Two BeanEventBean instances are equal if they have the same event type and refer to the same instance of event object. Clients that need to compute equality between Java beans wrapped by this class need to obtain the underlying object.


Constructor Summary
BeanEventBean(Object event, EventType eventType, Object eventId)
          Constructor.
 
Method Summary
 boolean equals(Object other)
           
 Object get(String property)
          Returns the value of an event property.
 Object getEventBeanId()
          Returns the event id object.
 EventType getEventType()
          Return the EventType instance that describes the set of properties available for this event.
 Object getUnderlying()
          Get the underlying data object to this event wrapper.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BeanEventBean

public BeanEventBean(Object event,
                     EventType eventType,
                     Object eventId)
Constructor.

Parameters:
event - is the event object
eventId - is an optional event id for the event
eventType - is the schema information for the event object.
Method Detail

getEventBeanId

public Object getEventBeanId()
Description copied from interface: EventBeanSPI
Returns the event id object.

Specified by:
getEventBeanId in interface EventBeanSPI
Returns:
event id

getUnderlying

public 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.

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

equals

public final boolean equals(Object other)
Overrides:
equals in class Object

get

public Object get(String property)
           throws 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
IllegalArgumentException

toString

public String toString()
Overrides:
toString in class Object