本文整理汇总了Java中com.espertech.esper.event.EventTypeMetadata.createNonPojoApplicationType方法的典型用法代码示例。如果您正苦于以下问题:Java EventTypeMetadata.createNonPojoApplicationType方法的具体用法?Java EventTypeMetadata.createNonPojoApplicationType怎么用?Java EventTypeMetadata.createNonPojoApplicationType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.espertech.esper.event.EventTypeMetadata
的用法示例。
在下文中一共展示了EventTypeMetadata.createNonPojoApplicationType方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setUp
import com.espertech.esper.event.EventTypeMetadata; //导入方法依赖的package包/类
public void setUp() {
eventAdapterService = SupportEventAdapterService.getService();
EventTypeMetadata metadata = EventTypeMetadata.createNonPojoApplicationType(EventTypeMetadata.ApplicationType.MAP, "typename", true, true, true, false, false);
Map<String, Object> testTypesMap = new HashMap<String, Object>();
testTypesMap.put("myInt", Integer.class);
testTypesMap.put("myString", String.class);
testTypesMap.put("myNullableString", String.class);
testTypesMap.put("mySupportBean", SupportBean.class);
testTypesMap.put("myComplexBean", SupportBeanComplexProps.class);
testTypesMap.put("myNullableSupportBean", SupportBean.class);
testTypesMap.put("myNullType", null);
eventType = new MapEventType(metadata, "", 1, eventAdapterService, testTypesMap, null, null, null);
}
示例2: testEquals
import com.espertech.esper.event.EventTypeMetadata; //导入方法依赖的package包/类
public void testEquals() {
EventTypeMetadata metadata = EventTypeMetadata.createNonPojoApplicationType(EventTypeMetadata.ApplicationType.MAP, "", true, true, true, false, false);
Map<String, Object> mapTwo = new LinkedHashMap<String, Object>();
mapTwo.put("myInt", int.class);
mapTwo.put("mySupportBean", SupportBean.class);
mapTwo.put("myNullableSupportBean", SupportBean.class);
mapTwo.put("myComplexBean", SupportBeanComplexProps.class);
assertFalse((new MapEventType(metadata, "", 1, eventAdapterService, mapTwo, null, null, null)).equals(eventType));
mapTwo.put("myString", String.class);
mapTwo.put("myNullableString", String.class);
mapTwo.put("myNullType", null);
// compare, should equal
assertTrue(new MapEventType(metadata, "", 1, eventAdapterService, mapTwo, null, null, null).equalsCompareType(eventType));
assertFalse((new MapEventType(metadata, "google", 1, eventAdapterService, mapTwo, null, null, null)).equalsCompareType(eventType));
mapTwo.put("xx", int.class);
assertFalse(eventType.equalsCompareType(new MapEventType(metadata, "", 1, eventAdapterService, mapTwo, null, null, null)));
mapTwo.remove("xx");
assertTrue(eventType.equalsCompareType(new MapEventType(metadata, "", 1, eventAdapterService, mapTwo, null, null, null)));
mapTwo.put("myInt", Integer.class);
assertTrue(eventType.equalsCompareType(new MapEventType(metadata, "", 1, eventAdapterService, mapTwo, null, null, null)));
mapTwo.remove("myInt");
assertFalse(eventType.equalsCompareType(new MapEventType(metadata, "", 1, eventAdapterService, mapTwo, null, null, null)));
mapTwo.put("myInt", int.class);
assertTrue(eventType.equalsCompareType(new MapEventType(metadata, "", 1, eventAdapterService, mapTwo, null, null, null)));
// Test boxed and primitive compatible
Map<String, Object> mapOne = new LinkedHashMap<String, Object>();
mapOne.put("myInt", int.class);
mapTwo = new LinkedHashMap<String, Object>();
mapTwo.put("myInt", Integer.class);
assertTrue(new MapEventType(metadata, "T1", 1, eventAdapterService, mapOne, null, null, null).equalsCompareType(new MapEventType(metadata, "T1", 1, eventAdapterService, mapTwo, null, null, null)));
}
示例3: setUp
import com.espertech.esper.event.EventTypeMetadata; //导入方法依赖的package包/类
public void setUp() {
testTypesMap = new HashMap<String, Object>();
testTypesMap.put("aString", String.class);
testTypesMap.put("anInt", Integer.class);
testTypesMap.put("myComplexBean", SupportBeanComplexProps.class);
testValuesMap = new HashMap<String, Object>();
testValuesMap.put("aString", "test");
testValuesMap.put("anInt", 10);
testValuesMap.put("myComplexBean", supportBean);
EventTypeMetadata metadata = EventTypeMetadata.createNonPojoApplicationType(EventTypeMetadata.ApplicationType.MAP, "testtype", true, true, true, false, false);
eventType = new MapEventType(metadata, "", 1, SupportEventAdapterService.getService(), testTypesMap, null, null, null);
eventBean = new MapEventBean(testValuesMap, eventType);
}
示例4: setUp
import com.espertech.esper.event.EventTypeMetadata; //导入方法依赖的package包/类
public void setUp() {
eventAdapterService = SupportEventAdapterService.getService();
EventTypeMetadata metadata = EventTypeMetadata.createNonPojoApplicationType(EventTypeMetadata.ApplicationType.OBJECTARR, "typename", true, true, true, false, false);
String[] names = {"myInt", "myIntBoxed", "myString", "mySupportBean", "myComplexBean", "myNullType"};
Object[] types = {Integer.class, Integer.class, String.class, SupportBean.class, SupportBeanComplexProps.class, null};
Map<String, Object> namesAndTypes = new LinkedHashMap<String, Object>();
for (int i = 0; i < names.length; i++) {
namesAndTypes.put(names[i], types[i]);
}
eventType = new ObjectArrayEventType(metadata, "typename", 1, eventAdapterService, namesAndTypes, null, null, null);
}
示例5: setUp
import com.espertech.esper.event.EventTypeMetadata; //导入方法依赖的package包/类
public void setUp() {
testProps = new String[]{"aString", "anInt", "myComplexBean"};
testTypes = new Object[]{String.class, Integer.class, SupportBeanComplexProps.class};
Map<String, Object> typeRep = new LinkedHashMap<String, Object>();
for (int i = 0; i < testProps.length; i++) {
typeRep.put(testProps[i], testTypes[i]);
}
testValues = new Object[]{"test", 10, supportBean};
EventTypeMetadata metadata = EventTypeMetadata.createNonPojoApplicationType(EventTypeMetadata.ApplicationType.OBJECTARR, "testtype", true, true, true, false, false);
eventType = new ObjectArrayEventType(metadata, "", 1, SupportEventAdapterService.getService(), typeRep, null, null, null);
eventBean = new ObjectArrayEventBean(testValues, eventType);
}
示例6: setUp
import com.espertech.esper.event.EventTypeMetadata; //导入方法依赖的package包/类
public void setUp()
{
eventAdapterService = SupportEventAdapterService.getService();
EventTypeMetadata metadata = EventTypeMetadata.createNonPojoApplicationType(EventTypeMetadata.ApplicationType.MAP, "typename", true, true, true, false, false);
Map<String, Object> testTypesMap = new HashMap<String, Object>();
testTypesMap.put("myInt", int.class);
testTypesMap.put("myString", String.class);
testTypesMap.put("myNullableString", String.class);
testTypesMap.put("mySupportBean", SupportBean.class);
testTypesMap.put("myComplexBean", SupportBeanComplexProps.class);
testTypesMap.put("myNullableSupportBean", SupportBean.class);
testTypesMap.put("myNullType", null);
eventType = new MapEventType(metadata, "", 1, eventAdapterService, testTypesMap, null, null, null);
}
示例7: testEquals
import com.espertech.esper.event.EventTypeMetadata; //导入方法依赖的package包/类
public void testEquals()
{
EventTypeMetadata metadata = EventTypeMetadata.createNonPojoApplicationType(EventTypeMetadata.ApplicationType.MAP, "", true, true, true, false, false);
Map<String, Object> mapTwo = new LinkedHashMap<String, Object>();
mapTwo.put("myInt", int.class);
mapTwo.put("mySupportBean", SupportBean.class);
mapTwo.put("myNullableSupportBean", SupportBean.class);
mapTwo.put("myComplexBean", SupportBeanComplexProps.class);
assertFalse((new MapEventType(metadata, "", 1, eventAdapterService, mapTwo, null, null, null)).equals(eventType));
mapTwo.put("myString", String.class);
mapTwo.put("myNullableString", String.class);
mapTwo.put("myNullType", null);
// compare, should equal
assertTrue(new MapEventType(metadata, "", 1, eventAdapterService, mapTwo, null, null, null).equalsCompareType(eventType));
assertFalse((new MapEventType(metadata, "google", 1, eventAdapterService, mapTwo, null, null, null)).equalsCompareType(eventType));
mapTwo.put("xx", int.class);
assertFalse(eventType.equalsCompareType(new MapEventType(metadata, "", 1, eventAdapterService, mapTwo, null, null, null)));
mapTwo.remove("xx");
assertTrue(eventType.equalsCompareType(new MapEventType(metadata, "", 1, eventAdapterService, mapTwo, null, null, null)));
mapTwo.put("myInt", Integer.class);
assertTrue(eventType.equalsCompareType(new MapEventType(metadata, "", 1, eventAdapterService, mapTwo, null, null, null)));
mapTwo.remove("myInt");
assertFalse(eventType.equalsCompareType(new MapEventType(metadata, "", 1, eventAdapterService, mapTwo, null, null, null)));
mapTwo.put("myInt", int.class);
assertTrue(eventType.equalsCompareType(new MapEventType(metadata, "", 1, eventAdapterService, mapTwo, null, null, null)));
// Test boxed and primitive compatible
Map<String, Object> mapOne = new LinkedHashMap<String, Object>();
mapOne.put("myInt", int.class);
mapTwo = new LinkedHashMap<String, Object>();
mapTwo.put("myInt", Integer.class);
assertTrue(new MapEventType(metadata, "T1", 1, eventAdapterService, mapOne, null, null, null).equalsCompareType(new MapEventType(metadata, "T1", 1, eventAdapterService, mapTwo, null, null, null)));
}
示例8: setUp
import com.espertech.esper.event.EventTypeMetadata; //导入方法依赖的package包/类
public void setUp() {
eventAdapterService = SupportEventAdapterService.getService();
EventTypeMetadata metadata = EventTypeMetadata.createNonPojoApplicationType(EventTypeMetadata.ApplicationType.OBJECTARR, "typename", true, true, true, false, false);
String[] names = {"myInt", "myIntBoxed", "myString", "mySupportBean", "myComplexBean", "myNullType"};
Object[] types = {int.class, Integer.class, String.class, SupportBean.class, SupportBeanComplexProps.class, null};
Map<String, Object> namesAndTypes = new LinkedHashMap<String, Object>();
for (int i = 0; i < names.length; i++) {
namesAndTypes.put(names[i], types[i]);
}
eventType = new ObjectArrayEventType(metadata, "typename", 1, eventAdapterService, namesAndTypes, null, null, null);
}
示例9: makeAvroSupportEventType
import com.espertech.esper.event.EventTypeMetadata; //导入方法依赖的package包/类
public static AvroEventType makeAvroSupportEventType(Schema schema) {
EventTypeMetadata metadata = EventTypeMetadata.createNonPojoApplicationType(EventTypeMetadata.ApplicationType.AVRO, "typename", true, true, true, false, false);
return new AvroEventType(metadata, "typename", 1, SupportEventAdapterService.getService(), schema, null, null, null, null);
}