EventMapper { public Map<String, Object> esperTypeFromEventType(EventType eventType) { Map<String, Object> properties = new HashMap<>(); for (Attribute attribute : eventType.getAttributes()) { for (Metadata meta : attribute.getMetadata()) { properties.put(attribute.getName() + "_" + meta.getName(), classForType(meta.getType())); } } for (Attribute attribute : eventType.getAttributes()) { properties.put(attribute.getName(), classForType(attribute.getType())); } properties.put("id", String.class); return properties; }  void setConfiguration(Configuration configuration); Map<String, Object> esperTypeFromEventType(EventType eventType); Event eventFromContextElement(ContextElement contextElement); ContextElement contextElementFromEvent(EventBean eventBean, EventType eventType); Object attributeValueFromEventProperty(Object value, String type);  }
@Test public void testEsperTypes() { EventType e = new EventType("ID", "TYPE", false); e.addAttribute(new Attribute("1", "string")); e.addAttribute(new Attribute("2", "double")); e.addAttribute(new Attribute("3", "int")); e.addAttribute(new Attribute("4", "float")); e.addAttribute(new Attribute("5", "boolean")); e.addAttribute(new Attribute("6", "XXXX")); e.addAttribute(new Attribute("7", "long")); e.addAttribute(new Attribute("8", "date")); e.addAttribute(new Attribute("9", "geo:point")); Map<String, Object> map = eventMapper.esperTypeFromEventType(e); assertEquals(String.class, map.get("id")); assertEquals(String.class, map.get("1")); assertEquals(double.class, map.get("2")); assertEquals(int.class, map.get("3")); assertEquals(float.class, map.get("4")); assertEquals(boolean.class, map.get("5")); assertEquals(long.class, map.get("7")); assertEquals(Date.class, map.get("8")); assertEquals(Geometry.class, map.get("9")); }