/** * NOTE: Code-generation-invoked method, method name and parameter order matters * * @param props props * @param eventsPerStream events * @param emptyExpressions flag * @param eventBeanTypedEventFactory svc * @param resultEventType type * @return bean */ public static EventBean processSelectExprSSWrapper(Map<String, Object> props, EventBean[] eventsPerStream, boolean emptyExpressions, EventBeanTypedEventFactory eventBeanTypedEventFactory, EventType resultEventType) { EventBean theEvent = eventsPerStream[0]; return eventBeanTypedEventFactory.adapterForTypedWrapper(theEvent, props, resultEventType); } }
public static EventBean wildcardNestedWrapper(EventBean event, EventType innerWrapperType, EventType outerWrapperType, EventBeanTypedEventFactory factory, Map<String, Object> props) { EventBean inner = factory.adapterForTypedWrapper(event, Collections.emptyMap(), innerWrapperType); return factory.adapterForTypedWrapper(inner, props, outerWrapperType); } }
public EventBean wrap(Object underlying) { EventBean bean = eventBeanTypedEventFactory.adapterForTypedBean(underlying, beanEventType); return eventBeanTypedEventFactory.adapterForTypedWrapper(bean, Collections.<String, Object>emptyMap(), wrapperEventType); }
public EventBean copy(EventBean theEvent) { DecoratingEventBean decorated = (DecoratingEventBean) theEvent; EventBean decoratedUnderlying = decorated.getUnderlyingEvent(); Map<String, Object> copiedMap = new HashMap<String, Object>(decorated.getDecoratingProperties()); return eventAdapterService.adapterForTypedWrapper(decoratedUnderlying, copiedMap, wrapperEventType); } }
/** * Add a property to the event passed in. * * @param originalEvent - event to add property to * @param propertyNames - names of properties to add * @param propertyValues - value of properties to add * @param targetEventType - new event type * @param eventAdapterService - service for generating events and handling event types * @return event with added property */ protected static EventBean addProperty(EventBean originalEvent, String[] propertyNames, Object propertyValues, EventType targetEventType, EventBeanTypedEventFactory eventAdapterService) { Map<String, Object> values = new HashMap<String, Object>(); if (propertyValues instanceof HashableMultiKey) { HashableMultiKey props = (HashableMultiKey) propertyValues; Object[] propertyValuesArr = props.getKeys(); for (int i = 0; i < propertyNames.length; i++) { values.put(propertyNames[i], propertyValuesArr[i]); } } else { values.put(propertyNames[0], propertyValues); } return eventAdapterService.adapterForTypedWrapper(originalEvent, values, targetEventType); }
public EventBean copy(EventBean theEvent) { DecoratingEventBean decorated = (DecoratingEventBean) theEvent; EventBean decoratedUnderlying = decorated.getUnderlyingEvent(); EventBean copiedUnderlying = underlyingCopyMethod.copy(decoratedUnderlying); if (copiedUnderlying == null) { return null; } Map<String, Object> copiedMap = new HashMap<String, Object>(decorated.getDecoratingProperties()); return eventAdapterService.adapterForTypedWrapper(copiedUnderlying, copiedMap, wrapperEventType); } }
public EventBean copy(EventBean theEvent) { DecoratingEventBean decorated = (DecoratingEventBean) theEvent; EventBean decoratedUnderlying = decorated.getUnderlyingEvent(); EventBean copiedUnderlying = underlyingCopyMethod.copy(decoratedUnderlying); if (copiedUnderlying == null) { return null; } return eventAdapterService.adapterForTypedWrapper(copiedUnderlying, decorated.getDecoratingProperties(), wrapperEventType); } }
converted = eventAdapterService.adapterForTypedWrapper(wrapper.getUnderlyingEvent(), wrapper.getDecoratingProperties(), targetType); converted = eventAdapterService.adapterForTypedMap(mapEvent.getProperties(), targetType); } else if ((theEvent.getEventType() instanceof MapEventType) && (targetType instanceof WrapperEventType)) { converted = eventAdapterService.adapterForTypedWrapper(theEvent, Collections.EMPTY_MAP, targetType); } else if ((theEvent.getEventType() instanceof BeanEventType) && (targetType instanceof BeanEventType)) { converted = eventAdapterService.adapterForTypedBean(theEvent.getUnderlying(), targetType);