net.esper.event
Class BeanEventBean

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

public class BeanEventBean
extends java.lang.Object
implements EventBean

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 EventTypeFactory. 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
protected BeanEventBean(java.lang.Object event, EventType eventType)
          Constructor.
 
Method Summary
 boolean equals(java.lang.Object other)
           
 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.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BeanEventBean

protected BeanEventBean(java.lang.Object event,
                        EventType eventType)
Constructor.

Parameters:
event - is the event object
eventType - is the schema information for the event object.
Method Detail

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.

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(java.lang.Object other)
Overrides:
equals in class java.lang.Object

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

toString

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