2017-01-30 4 views
0

Esper의 수신기 메서드를 업데이트하기 위해 일부 이벤트를 보내고 있지만 개체를 ​​받고 있는데 update() 메서드가이를 일부 Hashmap에 래핑합니다. 거기에서 개체를 검색 할 수 없습니다.업데이트 수신기 메서드에서 Esper의 이벤트 개체 속성에 액세스 할 수 없습니다.

public static class CEPListener implements UpdateListener { 
    public void update(EventBean[] newData, EventBean[] oldData) { 
      // put some condition here before sending to crowd....... 
      System.out.println("Event received: " 
           + newData[0].getUnderlying()); 
      System.out.println("Sending event to crowd.........");  
     } 
    } 
내가 newData의 내부에 내 원하는 개체를 얻을 수 위의 함수에서

하지만 일부지도에 싸여 나는 그것에서 내 개체를 검색 할 수있는 방법을 찾을 수 없습니다입니다. 아래 화면에서 newData [0] .getUnderlying()에는 다양한 속성이 있으며 object methods에 액세스 할 수없는 빨간색 사각형 아래에 값 개체가 필요합니다. 도움에 감사 할 것입니다. Attributes of newData[0].getUnderlying()

답변

0

확인. 나는 대답을 얻었다.

   for (EventBean eb : newData) { 
       if (eb instanceof MapEventBean) { 
        //MapEvent event = null; 
        if (eb.getUnderlying() instanceof Map<?, ?>) { 
         Map<?, ?> alert = (Map<?, ?>) eb.getUnderlying(); 
         for (Entry<?, ?> entry : alert.entrySet()) 
         { 
          System.out.println(entry.getValue()); 
         } 


        }