@Test public void testDecisionMatch() throws Exception { final JSONObject j = getObjectByLayerId("decisionMatch", "layout"); assertEquals("thirdLabel", getExpressionEvaluation(j, "match-thirdLabel")); assertEquals("defaultLabel", getExpressionEvaluation(j, "match-noMatchingLabel")); assertEquals("arrayLabel", getExpressionEvaluation(j, "match-arrayLabel")); assertEquals("thirdLabel", getExpressionEvaluation(j, "match-expressionThirdLabel")); assertEquals("arrayLabel", getExpressionEvaluation(j, "match-expressionArrayLabel")); assertEquals("thirdLabel", getExpressionEvaluation(j, "match-expressionLabelThirdLabel")); assertEquals("arrayLabel", getExpressionEvaluation(j, "match-expressionLabelArrayLabel")); }
private Expression decisionMatch() { if (json.size() < 4) { throwInsufficientArgumentCount(COALESCE, 3); } 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("match", expressions); }
MBDecision extends MBExpression { private Expression decisionMatch() { if (json.size() < 4) { throwInsufficientArgumentCount(COALESCE, 3); } 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("match", expressions); } }
MBDecision extends MBExpression { private Expression decisionMatch() { if (json.size() < 4) { throwInsufficientArgumentCount(COALESCE, 3); } 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("match", expressions); } MBDecision(JSONArray json); }
MBDecision extends MBExpression { private Expression decisionMatch() { if (json.size() < 4) { throwInsufficientArgumentCount(COALESCE, 3); } 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("match", expressions); } MBDecision(JSONArray json); @Override Expression getExpression(); }
MBDecision extends MBExpression { private Expression decisionMatch() { if (json.size() < 4) { throwInsufficientArgumentCount(COALESCE, 3); } 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("match", expressions); } MBDecision(JSONArray json); @Override Expression getExpression();  }