public static EventBean WildcardNestedWrapper(
     EventBean @event,
     EventType innerWrapperType,
     EventType outerWrapperType,
     EventBeanTypedEventFactory factory,
     IDictionary<string, object> props)
 {
     EventBean inner = factory.AdapterForTypedWrapper(
         @event,
         EmptyDictionary<string, object>.Instance,
         innerWrapperType);
     return factory.AdapterForTypedWrapper(inner, props, outerWrapperType);
 }
 public EventBean Copy(EventBean theEvent)
 {
     var decorated = (DecoratingEventBean) theEvent;
     var decoratedUnderlying = decorated.UnderlyingEvent;
     IDictionary<string, object> copiedMap = new Dictionary<string, object>(decorated.DecoratingProperties);
     return eventAdapterService.AdapterForTypedWrapper(decoratedUnderlying, copiedMap, wrapperEventType);
 }
Exemplo n.º 3
0
 public EventBean Wrap(object underlying)
 {
     var bean = eventBeanTypedEventFactory.AdapterForTypedObject(underlying, beanEventType);
     return eventBeanTypedEventFactory.AdapterForTypedWrapper(
         bean,
         Collections.GetEmptyMap<string, object>(),
         wrapperEventType);
 }
Exemplo n.º 4
0
        public EventBean Copy(EventBean theEvent)
        {
            var decorated = (DecoratingEventBean) theEvent;
            var decoratedUnderlying = decorated.UnderlyingEvent;
            var copiedUnderlying = underlyingCopyMethod.Copy(decoratedUnderlying);
            if (copiedUnderlying == null) {
                return null;
            }

            return eventAdapterService.AdapterForTypedWrapper(
                copiedUnderlying,
                decorated.DecoratingProperties,
                wrapperEventType);
        }
Exemplo n.º 5
0
 /// <summary>
 /// NOTE: Code-generation-invoked method, method name and parameter order matters
 /// </summary>
 /// <param name="props">props</param>
 /// <param name="eventsPerStream">events</param>
 /// <param name="emptyExpressions">flag</param>
 /// <param name="eventBeanTypedEventFactory">svc</param>
 /// <param name="resultEventType">type</param>
 /// <returns>bean</returns>
 public static EventBean ProcessSelectExprSSWrapper(
     IDictionary<string, object> props,
     EventBean[] eventsPerStream,
     bool emptyExpressions,
     EventBeanTypedEventFactory eventBeanTypedEventFactory,
     EventType resultEventType)
 {
     var theEvent = eventsPerStream[0];
     var wrapper = (DecoratingEventBean) theEvent;
     if (wrapper != null) {
         var map = wrapper.DecoratingProperties;
         if (emptyExpressions && !map.IsEmpty()) {
             props = new Dictionary<string, object>(map); 
         } else {
             props.PutAll(map);
         }
     }
     return eventBeanTypedEventFactory.AdapterForTypedWrapper(theEvent, props, resultEventType);
 }
        /// <summary>
        ///     Add a property to the event passed in.
        /// </summary>
        /// <param name="originalEvent">event to add property to</param>
        /// <param name="propertyNames">names of properties to add</param>
        /// <param name="propertyValues">value of properties to add</param>
        /// <param name="targetEventType">new event type</param>
        /// <param name="eventAdapterService">service for generating events and handling event types</param>
        /// <returns>event with added property</returns>
        internal static EventBean AddProperty(
            EventBean originalEvent,
            string[] propertyNames,
            object propertyValues,
            EventType targetEventType,
            EventBeanTypedEventFactory eventAdapterService)
        {
            var values = new Dictionary<string, object>();
            if (propertyValues is MultiKey props) {
                for (int i = 0; i < propertyNames.Length; i++) {
                    values.Put(propertyNames[i], props.GetKey(i));
                }
            } else {
                if (propertyValues is MultiKeyArrayWrap multiKeyArrayWrap) {
                    propertyValues = multiKeyArrayWrap.Array;
                }
                values.Put(propertyNames[0], propertyValues);
            }

            return eventAdapterService.AdapterForTypedWrapper(originalEvent, values, targetEventType);
        }