• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Event类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.wso2.siddhi.core.event.Event的典型用法代码示例。如果您正苦于以下问题:Java Event类的具体用法?Java Event怎么用?Java Event使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Event类属于org.wso2.siddhi.core.event包,在下文中一共展示了Event类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: testClusTree2D_24

import org.wso2.siddhi.core.event.Event; //导入依赖的package包/类
@Test
public void testClusTree2D_24() throws Exception {
    logger.info("ClusTreeStreamProcessorExtension Test - Test case with non-numeric event data");
    SiddhiManager siddhiManager = new SiddhiManager();
    String inputStream = "define stream InputStream (x double, y double);";

    String query = (
            "@info(name = 'query1') " +
                    "from InputStream#streamingml:clusTree(2, x, y) " +
                    "select closestCentroidCoordinate1, closestCentroidCoordinate2, x, y " +
                    "insert into OutputStream;");
    SiddhiAppRuntime siddhiAppRuntime = siddhiManager.createSiddhiAppRuntime(inputStream + query);

    siddhiAppRuntime.addCallback("query1", new QueryCallback() {
        @Override
        public void receive(long timeStamp, Event[] inEvents, Event[] removeEvents) {
            EventPrinter.print(inEvents);
        }
    });


    siddhiAppRuntime.start();
    InputHandler inputHandler = siddhiAppRuntime.getInputHandler("InputStream");
    inputHandler.send(new Object[]{5.7905, "hi"});
}
 
开发者ID:wso2-extensions,项目名称:siddhi-gpl-execution-streamingml,代码行数:26,代码来源:ClusTreeStreamProcessorExtensionTest.java


示例2: mapAndSend

import org.wso2.siddhi.core.event.Event; //导入依赖的package包/类
@Override
public void mapAndSend(Event[] events, OptionHolder optionHolder,
                       Map<String, TemplateBuilder> payloadTemplateBuilderMap, SinkListener sinkListener) {

    StringBuilder sb = new StringBuilder();
    if (payloadTemplateBuilderMap == null) {
        String jsonString = constructJsonForDefaultMapping(events);
        sb.append(jsonString);
    } else {
        sb.append(constructJsonForCustomMapping(events,
                payloadTemplateBuilderMap.get(payloadTemplateBuilderMap.keySet().iterator().next())));
    }

    if (!isJsonValidationEnabled) {
        sinkListener.publish(sb.toString());
    } else if (isValidJson(sb.toString())) {
        sinkListener.publish(sb.toString());
    } else {
        log.error("Invalid json string : " + sb.toString() + ". Hence dropping the message.");
    }
}
 
开发者ID:wso2-extensions,项目名称:siddhi-map-json,代码行数:22,代码来源:JsonSinkMapper.java


示例3: testConvertFunctionQuery8

import org.wso2.siddhi.core.event.Event; //导入依赖的package包/类
@Test
public void testConvertFunctionQuery8() throws InterruptedException {
    log.info("ConvertFunction test8");

    SiddhiManager siddhiManager = new SiddhiManager();
    InputHandler inputHandler = siddhiManager.defineStream("define stream typeStream (typeS string, typeF float, typeD double, typeI int, typeL long, typeB bool) ");


    String queryReference = siddhiManager.addQuery("from typeStream " +
                                                   " select convert(typeL,string,'dd:MM:yy') as type1;");

    siddhiManager.addCallback(queryReference, new QueryCallback() {
        @Override
        public void receive(long timeStamp, Event[] inEvents, Event[] removeEvents) {
            EventPrinter.print(timeStamp, inEvents, removeEvents);
            eventCount++;
            Assert.assertEquals("05:07:13", inEvents[0].getData0());
        }
    });

    inputHandler.send(new Object[]{"23:01:13", 1f, 1d, 1, 1373043027082l, true});
    junit.framework.Assert.assertEquals(1, eventCount);
    siddhiManager.shutdown();
}
 
开发者ID:redBorder,项目名称:rb-bi,代码行数:25,代码来源:ConvertTestCase.java


示例4: testFilterQuery89

import org.wso2.siddhi.core.event.Event; //导入依赖的package包/类
@Test
public void testFilterQuery89() throws InterruptedException {
    log.info("Filter test89");

    SiddhiManager siddhiManager = new SiddhiManager();
    InputHandler inputHandler = siddhiManager.defineStream(QueryFactory.createStreamDefinition().name("cseEventStream").attribute("symbol", Attribute.Type.STRING).attribute("price", Attribute.Type.FLOAT).attribute("volume", Attribute.Type.DOUBLE).attribute("quantity", Attribute.Type.INT));

    String queryReference = siddhiManager.addQuery("from cseEventStream[quantity < 50d] select symbol,price,quantity;");

    siddhiManager.addCallback(queryReference, new QueryCallback() {
        @Override
        public void receive(long timeStamp, Event[] inEvents, Event[] removeEvents) {
            EventPrinter.print(timeStamp, inEvents, removeEvents);
            count++;
        }
    });

    inputHandler.send(new Object[]{"WSO2", 50f, 60d, 6});
    inputHandler.send(new Object[]{"WSO2", 70f, 40d, 10});
    inputHandler.send(new Object[]{"WSO2", 44f, 200d, 56});
    Thread.sleep(100);
    Assert.assertEquals(2, count);
    siddhiManager.shutdown();

}
 
开发者ID:redBorder,项目名称:rb-bi,代码行数:26,代码来源:FilterTestCase.java


示例5: testFilterQuery87

import org.wso2.siddhi.core.event.Event; //导入依赖的package包/类
@Test
public void testFilterQuery87() throws InterruptedException {
    log.info("Filter test87");

    SiddhiManager siddhiManager = new SiddhiManager();
    InputHandler inputHandler = siddhiManager.defineStream(QueryFactory.createStreamDefinition().name("cseEventStream").attribute("symbol", Attribute.Type.STRING).attribute("price", Attribute.Type.FLOAT).attribute("volume", Attribute.Type.DOUBLE));

    String queryReference = siddhiManager.addQuery("from cseEventStream[price < 50d] select symbol,price;");

    siddhiManager.addCallback(queryReference, new QueryCallback() {
        @Override
        public void receive(long timeStamp, Event[] inEvents, Event[] removeEvents) {
            EventPrinter.print(timeStamp, inEvents, removeEvents);
            count++;
        }
    });

    inputHandler.send(new Object[]{"WSO2", 50f, 60d});
    inputHandler.send(new Object[]{"WSO2", 70f, 40d});
    inputHandler.send(new Object[]{"WSO2", 44f, 200d});
    Thread.sleep(100);
    Assert.assertEquals(1, count);
    siddhiManager.shutdown();

}
 
开发者ID:redBorder,项目名称:rb-bi,代码行数:26,代码来源:FilterTestCase.java


示例6: process

import org.wso2.siddhi.core.event.Event; //导入依赖的package包/类
public BundleEvent process(BundleEvent bundleEvent) {
    BundleEvent resultEvent = bundleEvent.getNewInstance();
    for (AtomicEvent event : bundleEvent.getEvents()) {
        if (conditionExecutor.execute(event)) {
            if (bundleEvent instanceof ListEvent) {
                ((ListEvent) resultEvent).addEvent((Event) event);
            } else {
                ((ListAtomicEvent) resultEvent).addEvent(event);

            }
        }
    }
    if (resultEvent.getActiveEvents() > 0) {
        return resultEvent;
    }
    return null;
}
 
开发者ID:redBorder,项目名称:rb-bi,代码行数:18,代码来源:FilterProcessor.java


示例7: testFilterQuery35

import org.wso2.siddhi.core.event.Event; //导入依赖的package包/类
@Test
public void testFilterQuery35() throws InterruptedException {
    log.info("Filter test35");

    SiddhiManager siddhiManager = new SiddhiManager();

    InputHandler inputHandler = siddhiManager.defineStream("define stream cseEventStream (symbol string, price double, volume int)");
    String queryReference = siddhiManager.addQuery("from cseEventStream[price != 50f ] select symbol,price,volume insert into outputStream ;");

    siddhiManager.addCallback(queryReference, new QueryCallback() {
        @Override
        public void receive(long timeStamp, Event[] inEvents, Event[] removeEvents) {
            EventPrinter.print(timeStamp, inEvents, removeEvents);
            count++;
        }
    });

    inputHandler.send(new Object[]{"WSO2", 50d, 50});
    inputHandler.send(new Object[]{"IBM", 55d, 100});
    Thread.sleep(100);
    Assert.assertEquals(1, count);
    siddhiManager.shutdown();
}
 
开发者ID:redBorder,项目名称:rb-bi,代码行数:24,代码来源:FilterTestCase.java


示例8: testFilterQuery102

import org.wso2.siddhi.core.event.Event; //导入依赖的package包/类
@Test
public void testFilterQuery102() throws InterruptedException {
    log.info("Filter test102");

    SiddhiManager siddhiManager = new SiddhiManager();
    InputHandler inputHandler = siddhiManager.defineStream(QueryFactory.createStreamDefinition().name("cseEventStream").attribute("symbol", Attribute.Type.STRING).attribute("price", Attribute.Type.FLOAT).attribute("volume", Attribute.Type.DOUBLE));

    String queryReference = siddhiManager.addQuery("from cseEventStream[price >= 55f] select symbol,price;");

    siddhiManager.addCallback(queryReference, new QueryCallback() {
        @Override
        public void receive(long timeStamp, Event[] inEvents, Event[] removeEvents) {
            EventPrinter.print(timeStamp, inEvents, removeEvents);
            count++;
        }
    });

    inputHandler.send(new Object[]{"WSO2", 50f, 60d});
    inputHandler.send(new Object[]{"WSO2", 70f, 40d});
    inputHandler.send(new Object[]{"WSO2", 44f, 200d});
    Thread.sleep(100);
    Assert.assertEquals(1, count);
    siddhiManager.shutdown();

}
 
开发者ID:redBorder,项目名称:rb-bi,代码行数:26,代码来源:FilterTestCase.java


示例9: testConvertFunctionQuery7

import org.wso2.siddhi.core.event.Event; //导入依赖的package包/类
@Test(expected = QueryCreationException.class)
public void testConvertFunctionQuery7() throws InterruptedException {
    log.info("ConvertFunction test7");

    SiddhiManager siddhiManager = new SiddhiManager();
    InputHandler inputHandler = siddhiManager.defineStream("define stream typeStream (typeS string, typeF float, typeD double, typeI int, typeL long, typeB bool) ");


    String queryReference = siddhiManager.addQuery("from typeStream " +
                                                   " select convert(typeS,int,'dd:MM:yy') as type1;");

    siddhiManager.addCallback(queryReference, new QueryCallback() {
        @Override
        public void receive(long timeStamp, Event[] inEvents, Event[] removeEvents) {
            EventPrinter.print(timeStamp, inEvents, removeEvents);
            eventCount++;
        }
    });

    inputHandler.send(new Object[]{"23:01:13", 1f, 1d, 1, 1l, true});
    junit.framework.Assert.assertEquals(1, eventCount);
    siddhiManager.shutdown();
}
 
开发者ID:redBorder,项目名称:rb-bi,代码行数:24,代码来源:ConvertTestCase.java


示例10: testFilterQuery36

import org.wso2.siddhi.core.event.Event; //导入依赖的package包/类
@Test
public void testFilterQuery36() throws InterruptedException {
    log.info("Filter test36");

    SiddhiManager siddhiManager = new SiddhiManager();

    InputHandler inputHandler = siddhiManager.defineStream("define stream cseEventStream (symbol string, price double, volume int)");
    String queryReference = siddhiManager.addQuery("from cseEventStream[price != 50d ] select symbol,price,volume insert into outputStream ;");

    siddhiManager.addCallback(queryReference, new QueryCallback() {
        @Override
        public void receive(long timeStamp, Event[] inEvents, Event[] removeEvents) {
            EventPrinter.print(timeStamp, inEvents, removeEvents);
            count++;
        }
    });

    inputHandler.send(new Object[]{"WSO2", 50d, 50});
    inputHandler.send(new Object[]{"IBM", 55d, 100});
    Thread.sleep(100);
    Assert.assertEquals(1, count);
    siddhiManager.shutdown();
}
 
开发者ID:redBorder,项目名称:rb-bi,代码行数:24,代码来源:FilterTestCase.java


示例11: testConvertFunctionQuery14

import org.wso2.siddhi.core.event.Event; //导入依赖的package包/类
@Test
public void testConvertFunctionQuery14() throws InterruptedException {
    log.info("ConvertFunction test14");

    SiddhiManager siddhiManager = new SiddhiManager();
    InputHandler inputHandler = siddhiManager.defineStream("define stream typeStream (typeS string, typeSF string, typeSF2 string, typeD double, typeI int, typeL long, typeB bool) ");


    String queryReference = siddhiManager.addQuery("from typeStream " +
                                                   " select convert(typeS, string,\"dd:MM:yy\",typeSF2) as type1;");

    siddhiManager.addCallback(queryReference, new QueryCallback() {
        @Override
        public void receive(long timeStamp, Event[] inEvents, Event[] removeEvents) {
            EventPrinter.print(timeStamp, inEvents, removeEvents);
            eventCount++;
            Assert.assertEquals("01-23-13", inEvents[0].getData0());
        }
    });

    inputHandler.send(new Object[]{"23:01:13", "", "MM-dd-yy", 1d, 1, 1373043027082l, true});
    junit.framework.Assert.assertEquals(1, eventCount);
    siddhiManager.shutdown();
}
 
开发者ID:redBorder,项目名称:rb-bi,代码行数:25,代码来源:ConvertTestCase.java


示例12: testFilterQuery64

import org.wso2.siddhi.core.event.Event; //导入依赖的package包/类
@Test
public void testFilterQuery64() throws InterruptedException {
    log.info("Filter test64");

    SiddhiManager siddhiManager = new SiddhiManager();
    InputHandler inputHandler = siddhiManager.defineStream(QueryFactory.createStreamDefinition().name("cseEventStream").attribute("symbol", Attribute.Type.STRING).attribute("price", Attribute.Type.FLOAT).attribute("volume", Attribute.Type.LONG));

    String queryReference = siddhiManager.addQuery("from cseEventStream[volume == 40f ] select symbol,price insert into outputStream;");

    siddhiManager.addCallback(queryReference, new QueryCallback() {
        @Override
        public void receive(long timeStamp, Event[] inEvents, Event[] removeEvents) {
            EventPrinter.print(timeStamp, inEvents, removeEvents);
            count++;
        }
    });

    inputHandler.send(new Object[]{"WSO2", 50f, 60l});
    inputHandler.send(new Object[]{"WSO2", 70f, 40l});
    inputHandler.send(new Object[]{"WSO2", 44f, 200l});
    Thread.sleep(100);
    Assert.assertEquals(1, count);
    siddhiManager.shutdown();

}
 
开发者ID:redBorder,项目名称:rb-bi,代码行数:26,代码来源:FilterTestCase.java


示例13: testConvertFunctionQuery4

import org.wso2.siddhi.core.event.Event; //导入依赖的package包/类
@Test(expected = QueryCreationException.class)
public void testConvertFunctionQuery4() throws InterruptedException {
    log.info("ConvertFunction test4");

    SiddhiManager siddhiManager = new SiddhiManager();
    InputHandler inputHandler = siddhiManager.defineStream("define stream typeStream (typeS string, typeF float, typeD double, typeI int, typeL long, typeB bool) ");


    String queryReference = siddhiManager.addQuery("from typeStream " +
                                                   " select convert(string) as type1;");

    siddhiManager.addCallback(queryReference, new QueryCallback() {
        @Override
        public void receive(long timeStamp, Event[] inEvents, Event[] removeEvents) {
            EventPrinter.print(timeStamp, inEvents, removeEvents);
            eventCount++;
        }
    });

    inputHandler.send(new Object[]{"true", 1f, 1d, 1, 1l, true});
    junit.framework.Assert.assertEquals(0, eventCount);
    siddhiManager.shutdown();

}
 
开发者ID:redBorder,项目名称:rb-bi,代码行数:25,代码来源:ConvertTestCase.java


示例14: testFilterQuery41

import org.wso2.siddhi.core.event.Event; //导入依赖的package包/类
@Test
public void testFilterQuery41() throws InterruptedException {
    log.info("Filter test41");

    SiddhiManager siddhiManager = new SiddhiManager();

    InputHandler inputHandler = siddhiManager.defineStream("define stream cseEventStream (symbol string, price double, volume int)");
    String queryReference = siddhiManager.addQuery("from cseEventStream[price > 50 ] select symbol,price,volume insert into outputStream ;");

    siddhiManager.addCallback(queryReference, new QueryCallback() {
        @Override
        public void receive(long timeStamp, Event[] inEvents, Event[] removeEvents) {
            EventPrinter.print(timeStamp, inEvents, removeEvents);
            count++;
        }
    });

    inputHandler.send(new Object[]{"WSO2", 50d, 50});
    inputHandler.send(new Object[]{"IBM", 55d, 100});
    Thread.sleep(100);
    Assert.assertEquals(1, count);
    siddhiManager.shutdown();
}
 
开发者ID:redBorder,项目名称:rb-bi,代码行数:24,代码来源:FilterTestCase.java


示例15: testFilterQuery68

import org.wso2.siddhi.core.event.Event; //导入依赖的package包/类
@Test
public void testFilterQuery68() throws InterruptedException {
    log.info("Filter test68");

    SiddhiManager siddhiManager = new SiddhiManager();
    InputHandler inputHandler = siddhiManager.defineStream(QueryFactory.createStreamDefinition().name("cseEventStream").attribute("symbol", Attribute.Type.STRING).attribute("price", Attribute.Type.DOUBLE).attribute("volume", Attribute.Type.LONG));

    String queryReference = siddhiManager.addQuery("from cseEventStream[price <= 100f] select symbol,price insert into outputStream;");

    siddhiManager.addCallback(queryReference, new QueryCallback() {
        @Override
        public void receive(long timeStamp, Event[] inEvents, Event[] removeEvents) {
            EventPrinter.print(timeStamp, inEvents, removeEvents);
            count++;
        }
    });

    inputHandler.send(new Object[]{"WSO2", 50d, 60l});
    inputHandler.send(new Object[]{"WSO2", 70d, 40l});
    inputHandler.send(new Object[]{"WSO2", 44d, 200l});
    Thread.sleep(100);
    Assert.assertEquals(3, count);
    siddhiManager.shutdown();

}
 
开发者ID:redBorder,项目名称:rb-bi,代码行数:26,代码来源:FilterTestCase.java


示例16: testConvertFunctionQuery10

import org.wso2.siddhi.core.event.Event; //导入依赖的package包/类
@Test
public void testConvertFunctionQuery10() throws InterruptedException {
    log.info("ConvertFunction test10");

    SiddhiManager siddhiManager = new SiddhiManager();
    InputHandler inputHandler = siddhiManager.defineStream("define stream typeStream (typeS string, typeSF string, typeD double, typeI int, typeL long, typeB bool) ");


    String queryReference = siddhiManager.addQuery("from typeStream " +
                                                   " select convert(typeS,long,typeSF) as type1;");

    siddhiManager.addCallback(queryReference, new QueryCallback() {
        @Override
        public void receive(long timeStamp, Event[] inEvents, Event[] removeEvents) {
            EventPrinter.print(timeStamp, inEvents, removeEvents);
            eventCount++;
            Assert.assertEquals(1358899200000l, inEvents[0].getData0());

        }
    });

    inputHandler.send(new Object[]{"23:01:13", "DD:MM:yy", 1d, 1, 1l, true});
    junit.framework.Assert.assertEquals(1, eventCount);
    siddhiManager.shutdown();
}
 
开发者ID:redBorder,项目名称:rb-bi,代码行数:26,代码来源:ConvertTestCase.java


示例17: testClusTree2D_27

import org.wso2.siddhi.core.event.Event; //导入依赖的package包/类
@Test
public void testClusTree2D_27() throws Exception {
    logger.info("ClusTreeStreamProcessorExtension Test - Test case to demo separate thread training");
    SiddhiManager siddhiManager = new SiddhiManager();
    String inputStream = "define stream InputStream (x double, y double);";

    String query = (
            "@info(name = 'query1') " +
                    "from InputStream#streamingml:clusTree(2, x, y) " +
                    "select closestCentroidCoordinate1, closestCentroidCoordinate2, x, y " +
                    "insert into OutputStream;");
    SiddhiAppRuntime siddhiAppRuntime = siddhiManager.createSiddhiAppRuntime(inputStream + query);

    siddhiAppRuntime.addCallback("query1", new QueryCallback() {
        @Override
        public void receive(long timeStamp, Event[] inEvents, Event[] removeEvents) {
            EventPrinter.print(inEvents);
        }
    });

    siddhiAppRuntime.start();
    InputHandler inputHandler = siddhiAppRuntime.getInputHandler("InputStream");
    Random random = new Random();
    try {
        for (int i = 0; i < 1100; i++) {
            inputHandler.send(new Object[]{random.nextInt(50), random.nextInt(50)});
            inputHandler.send(new Object[]{random.nextInt(50) + 100, random.nextInt(50) + 100});
        }
    } catch (Exception e) {
        logger.error(e.getCause().getMessage());
    } finally {
        siddhiAppRuntime.shutdown();
    }
}
 
开发者ID:wso2-extensions,项目名称:siddhi-gpl-execution-streamingml,代码行数:35,代码来源:ClusTreeStreamProcessorExtensionTest.java


示例18: testHoeffdingClassifierLearningExtension5

import org.wso2.siddhi.core.event.Event; //导入依赖的package包/类
@Test
public void testHoeffdingClassifierLearningExtension5() throws InterruptedException {
    logger.info("HoeffdingClassifierUpdaterStreamProcessorExtension TestCase - Label is of bool type");

    SiddhiManager siddhiManager = new SiddhiManager();

    String inStreamDefinition = "define stream StreamA (attribute_0 double, attribute_1 double, attribute_2 "
            + "double, attribute_3 double, attribute_4 bool );";

    String query = ("@info(name = 'query1') from StreamA#streamingml:updateHoeffdingTree('model1', 2, "
            + "attribute_0, attribute_1 , attribute_2 ,attribute_3,attribute_4) select attribute_0, "
            + "attribute_1, attribute_2, attribute_3, accuracy insert into"
            + " outputStream;");

    SiddhiAppRuntime siddhiAppRuntime = siddhiManager.createSiddhiAppRuntime(inStreamDefinition + query);
    siddhiAppRuntime.addCallback("query1", new QueryCallback() {

        @Override
        public void receive(long timeStamp, Event[] inEvents, Event[] removeEvents) {
            count.incrementAndGet();
            EventPrinter.print(inEvents);
        }
    });
    try {
        InputHandler inputHandler = siddhiAppRuntime.getInputHandler("StreamA");
        siddhiAppRuntime.start();
        inputHandler.send(new Object[]{0.1, 0.8, 0.2, 0.03, true});
        inputHandler.send(new Object[]{0.2, 0.95, 0.22, 0.1, true});
        inputHandler.send(new Object[]{0.8, 0.1, 0.65, 0.92, false});
        inputHandler.send(new Object[]{0.75, 0.1, 0.58, 0.71, false});

        SiddhiTestHelper.waitForEvents(200, 4, count, 60000);

    } catch (Exception e) {
        logger.error(e.getCause().getMessage());
    } finally {
        siddhiAppRuntime.shutdown();
    }
}
 
开发者ID:wso2-extensions,项目名称:siddhi-gpl-execution-streamingml,代码行数:40,代码来源:HoeffdingClassifierUpdaterStreamProcessorExtensionTestCase.java


示例19: constructSingleEventForDefaultMapping

import org.wso2.siddhi.core.event.Event; //导入依赖的package包/类
private JsonObject constructSingleEventForDefaultMapping(Event event) {
    Object[] data = event.getData();
    JsonObject jsonEventObject = new JsonObject();
    JsonObject innerParentObject = new JsonObject();
    String attributeName;
    Object attributeValue;
    Gson gson = new Gson();
    for (int i = 0; i < data.length; i++) {
        attributeName = attributeNameArray[i];
        attributeValue = data[i];
        if (attributeValue != null) {
            if (attributeValue.getClass() == String.class) {
                innerParentObject.addProperty(attributeName, attributeValue.toString());
            } else if (attributeValue instanceof Number) {
                innerParentObject.addProperty(attributeName, (Number) attributeValue);
            } else if (attributeValue instanceof Boolean) {
                innerParentObject.addProperty(attributeName, (Boolean) attributeValue);
            } else if (attributeValue instanceof Map) {
                if (!((Map) attributeValue).isEmpty()) {
                    innerParentObject.add(attributeName, gson.toJsonTree(attributeValue));
                }
            }
        }
    }
    jsonEventObject.add(EVENT_PARENT_TAG, innerParentObject);
    return jsonEventObject;
}
 
开发者ID:wso2-extensions,项目名称:siddhi-map-json,代码行数:28,代码来源:JsonSinkMapper.java


示例20: doPartialProcessing

import org.wso2.siddhi.core.event.Event; //导入依赖的package包/类
private Event doPartialProcessing(Event event) {
    Object[] data = event.getData();
    for (int i = 0; i < data.length; i++) {
        if (data[i] == null) {
            data[i] = UNDEFINED;
        }
    }
    return event;
}
 
开发者ID:wso2-extensions,项目名称:siddhi-map-json,代码行数:10,代码来源:JsonSinkMapper.java



注:本文中的org.wso2.siddhi.core.event.Event类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java R类代码示例发布时间:2022-05-21
下一篇:
Java TextureLoader类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap