@Test public void testDecisionCoalesce() throws Exception { final JSONObject j = getObjectByLayerId("decisionCoalesce", "layout"); assertEquals("aString", getExpressionEvaluation(j, "coalesce-stringNull")); assertEquals(5l, getExpressionEvaluation(j, "coalesce-nullNumber")); assertEquals("aString", getExpressionEvaluation(j, "coalesce-stringNullNumber")); assertEquals(5l, getExpressionEvaluation(j, "coalesce-nullNumberString")); assertEquals("aString", getExpressionEvaluation(j, "coalesce-chainedNullStringNumber")); }
private Expression decisionCoalesce() { if (json.size() < 2) { throwInsufficientArgumentCount(COALESCE, 1); } Expression[] expressions = new Expression[json.size() - 1]; for (int i = 1; i < json.size(); ++i) { Expression expression = parse.string(json, i); expressions[i - 1] = expression; } return ff.function("coalesce", expressions); }
MBDecision extends MBExpression { private Expression decisionCoalesce() { if (json.size() < 2) { throwInsufficientArgumentCount(COALESCE, 1); } Expression[] expressions = new Expression[json.size() - 1]; for (int i = 1; i < json.size(); ++i) { Expression expression = parse.string(json, i); expressions[i - 1] = expression; } return ff.function("coalesce", expressions); } }
MBDecision extends MBExpression { private Expression decisionCoalesce() { if (json.size() < 2) { throwInsufficientArgumentCount(COALESCE, 1); } Expression[] expressions = new Expression[json.size() - 1]; for (int i = 1; i < json.size(); ++i) { Expression expression = parse.string(json, i); expressions[i - 1] = expression; } return ff.function("coalesce", expressions); } MBDecision(JSONArray json); }
MBDecision extends MBExpression { private Expression decisionCoalesce() { if (json.size() < 2) { throwInsufficientArgumentCount(COALESCE, 1); } Expression[] expressions = new Expression[json.size() - 1]; for (int i = 1; i < json.size(); ++i) { Expression expression = parse.string(json, i); expressions[i - 1] = expression; } return ff.function("coalesce", expressions); } MBDecision(JSONArray json); @Override Expression getExpression(); }
MBDecision extends MBExpression { private Expression decisionCoalesce() { if (json.size() < 2) { throwInsufficientArgumentCount(COALESCE, 1); } Expression[] expressions = new Expression[json.size() - 1]; for (int i = 1; i < json.size(); ++i) { Expression expression = parse.string(json, i); expressions[i - 1] = expression; } return ff.function("coalesce", expressions); } MBDecision(JSONArray json); @Override Expression getExpression();  }