|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.apama.event.parser.FieldType<Event> com.apama.event.parser.EventType
public class EventType
Represents the definition of an Apama event type,
for which values are specified as Event
objects.
Each EventType consists of an event type name, and zero or more Field
objects.
Example usage can be found at the top level of this package.
Threading: The EventType class is not fully thread-safe, but once it has been initialized with all the required fields, it is safe to concurrently use it to parse and create event strings from any thread, provided fields are not added or removed from the event type (this would not happen in typical usage anyway).
Constructor Summary | |
---|---|
EventType(java.lang.String name,
Field<?>... fields)
Create a new Event Type by specifying the name of the event and the FieldType of each of the event parameter. |
Method Summary | ||
---|---|---|
void |
addField(Field<?> field)
Method to append extra field to the EventType. |
|
|
addField(java.lang.String name,
FieldType<T> fieldType)
Method to append extra field to the EventType. |
|
void |
assertAssignable(java.lang.Object c,
java.lang.String fieldName)
This method is intended for internal use only and may be removed at any time - do not use. |
|
boolean |
equals(java.lang.Object obj)
equals if both objects has same field names/types |
|
boolean |
fieldExists(java.lang.String fieldName,
FieldType<?> fieldType)
Method to check if this EventType contains a field with name fieldName AND type fieldType. |
|
Field<?> |
getField(java.lang.String fieldName)
Get a named field. |
|
java.lang.String[] |
getFieldNames()
Method to retrieve the field names as String array for the event. |
|
int |
hashCode()
|
|
Event |
parse(java.lang.String value)
Convert a value of this type from the format used in Apama event strings, into an Event object. |
|
java.lang.String |
toString()
Returns a String representation of the event type. |
Methods inherited from class com.apama.event.parser.FieldType |
---|
format, getName, getTypeClass, newField |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public EventType(java.lang.String name, Field<?>... fields)
name
- The name of this typefields
- Array of field definitions for each event parameterMethod Detail |
---|
public void addField(Field<?> field)
field
- a new field to append to the eventTypepublic <T> void addField(java.lang.String name, FieldType<T> fieldType)
name
- name of the fieldfieldType
- of the new field to be addedpublic java.lang.String[] getFieldNames()
public Field<?> getField(java.lang.String fieldName)
fieldName
- The fieldName to check
public boolean fieldExists(java.lang.String fieldName, FieldType<?> fieldType)
fieldName
- The fieldName to checkfieldType
- The fieldType to match
public void assertAssignable(java.lang.Object c, java.lang.String fieldName)
FieldType
assertAssignable
in class FieldType<Event>
public Event parse(java.lang.String value) throws ParserRuntimeException
parse
in class FieldType<Event>
value
- the value to parse.
ParserRuntimeException
- If the specified value string cannot be parsed.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class FieldType<Event>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |