@Test public void testEvaluateIEvent() throws StreamingException { Map<String, Object> values = new HashMap<String, Object>(); values.put("a", 1); values.put("b", 1); values.put("c", "c1"); IEvent event1 = new TupleEvent("stream", eventType, values); values = new HashMap<String, Object>(); values.put("a", null); values.put("b", 1); values.put("c", "c1"); IEvent event2 = new TupleEvent("stream", eventType, values); expr = new ExprIsNullExpression(toCompare, true); Assert.assertEquals(false, expr.evaluate(event1)); Assert.assertEquals(true, expr.evaluate(event2)); expr = new ExprIsNullExpression(toCompare, false); Assert.assertEquals(true, expr.evaluate(event1)); Assert.assertEquals(false, expr.evaluate(event2)); }
@Override public Object evaluate(IEvent theEvent) { if (theEvent == null) { LOG.error("Stream event is null."); throw new IllegalArgumentException("Stream event is null."); } Object lo = this.expr.evaluate(theEvent); return (lo == null) == isNull; }
ExprIsNullExpression implements IBooleanExpression { @Override public Object evaluate(IEvent theEvent) { if (theEvent == null) { LOG.error("Stream event is null."); throw new IllegalArgumentException("Stream event is null."); } Object lo = this.expr.evaluate(theEvent); return (lo == null) == isNull; } }
ExprIsNullExpression implements IBooleanExpression { @Override public Object evaluate(IEvent theEvent) { if (theEvent == null) { LOG.error("Stream event is null."); throw new IllegalArgumentException("Stream event is null."); } Object lo = this.expr.evaluate(theEvent); return (lo == null) == isNull; } ExprIsNullExpression(IExpression expr, Boolean isNull); }
ExprIsNullExpression implements IBooleanExpression { @Override public Object evaluate(IEvent theEvent) { if (theEvent == null) { LOG.error("Stream event is null."); throw new IllegalArgumentException("Stream event is null."); } Object lo = this.expr.evaluate(theEvent); return (lo == null) == isNull; } ExprIsNullExpression(IExpression expr, Boolean isNull); @Override Object evaluate(IEvent theEvent); @Override Object evaluate(IEvent[] eventsPerStream); @Override Class< ? > getType(); IExpression getExpr(); }
ExprIsNullExpression implements IBooleanExpression { @Override public Object evaluate(IEvent theEvent) { if (theEvent == null) { LOG.error("Stream event is null."); throw new IllegalArgumentException("Stream event is null."); } Object lo = this.expr.evaluate(theEvent); return (lo == null) == isNull; } ExprIsNullExpression(IExpression expr, Boolean isNull); @Override Object evaluate(IEvent theEvent); @Override Object evaluate(IEvent[] eventsPerStream); @Override Class< ? > getType(); IExpression getExpr();  }