public NotEqualsRXCondition(Expression<String> left, Expression<String> right) { super(left, right, "@nrx s"); pattern = Pattern.compile(right.getExpression()); }
private Expression<Serializable> buildSerializableExpression(String key) { Expression<Double> ed = dExps.get(key); if (ed != null) return ed.toSerializableExpression(); Expression<String> es = sExps.get(key); if (es != null) return es.toSerializableExpression(); return null; }
/** * @param data * @return a new Data witch was created by filtering the given data item * @throws Exception */ protected void filterAndEmit(Data data) throws Exception { Data d = DataFactory.create(); for (Expression<Serializable> f : filter) { d.put(f.getExpression(), f.get(this.context, data)); } if (sinks == null) { log.error("No Sinks injected!"); return; } for (int i = 0; i < sinks.length; i++) { try { sinks[i].write(d); } catch (Exception e) { e.printStackTrace(); } } }
@Override public Boolean get(Context ctx, Data item) throws Exception { Boolean b = exp.get(ctx, item); if (b == null) return null; return b == false; } }
public NotEqualsRXCondition(Expression<String> left, Expression<String> right) { super(left, right, "@nrx s"); pattern = Pattern.compile(right.getExpression()); }
private Expression<Serializable> buildSerializableExpression(String key) { Expression<Double> ed = dExps.get(key); if (ed != null) return ed.toSerializableExpression(); Expression<String> es = sExps.get(key); if (es != null) return es.toSerializableExpression(); return null; }
public EqualsRXCondition(Expression<String> left, Expression<String> right) { super(left, right, "@rx s"); pattern = Pattern.compile(right.getExpression()); }
public EqualsRXCondition(Expression<String> left, Expression<String> right) { super(left, right, "@rx s"); pattern = Pattern.compile(right.getExpression()); }
private Expression<String> createOrBuildStringExpression(String key) { Expression<String> e = sExps.get(key); if (e == null) { Expression<Double> d = dExps.get(key); if (d != null) key = "%{" + d.getExpression() + "}"; e = new StringExpression(key); } return e; }
@Override public Boolean get(Context ctx, Data item) throws Exception { Boolean b = exp.get(ctx, item); if (b == null) return null; return b == true; } }
private Expression<String> createOrBuildStringExpression(String key) { Expression<String> e = sExps.get(key); if (e == null) { Expression<Double> d = dExps.get(key); if (d != null) key = d.getExpression(); e = new StringExpression(key); } return e; }
/** * Create equals-true-condition out of a given string expression. * * @param expr expression value as string * @return condition */ private Condition extractEqualsTrueExpression(String expr) { Expression<Double> de = dExps.get(expr); if (de != null) { return new EqualsTrueCondition(new BooleanExpression(de.getExpression())); } return null; }
/** * Create equals-false-condition out of a given string expression. * * @param expr expression value as string * @return condition */ private Condition extractEqualsFalseExpression(String expr) { Expression<Double> de = dExps.get(expr); if (de != null) { return new EqualsFalseCondition(new BooleanExpression(de.getExpression())); } return null; }