@Test public void testNonExistingKeyEvalIsNilWithoutDefault() { boolean isNil = ff.isNil(ff.function("env", ff.literal("not existig key")), null).evaluate(null); assertTrue(isNil); }
@Override public Object evaluate(Object feature) { String varName = getExpression(0).evaluate(feature, String.class); Object value = localLookup.getTable().get(varName.toUpperCase()); if (value == null) { value = globalLookup.get(varName.toUpperCase()); } if (value == null) { final int paramSize = getParameters().size(); if (paramSize > NAME.getArgumentCount()) { value = getExpression(paramSize - 1).evaluate(feature); } } return value; }
EnvFunction extends FunctionExpressionImpl { @Override public Object evaluate(Object feature) { String varName = getExpression(0).evaluate(feature, String.class); Object value = localLookup.getTable().get(varName.toUpperCase()); if (value == null) { value = globalLookup.get(varName.toUpperCase()); } if (value == null) { final int paramSize = getParameters().size(); if (paramSize > NAME.getArgumentCount()) { value = getExpression(paramSize - 1).evaluate(feature); } } return value; } }
EnvFunction extends FunctionExpressionImpl { @Override public Object evaluate(Object feature) { String varName = getExpression(0).evaluate(feature, String.class); Object value = localLookup.getTable().get(varName.toUpperCase()); if (value == null) { value = globalLookup.get(varName.toUpperCase()); } if (value == null) { final int paramSize = getParameters().size(); if (paramSize > NAME.getArgumentCount()) { value = getExpression(paramSize - 1).evaluate(feature); } } return value; } EnvFunction(); }
EnvFunction extends FunctionExpressionImpl { @Override public Object evaluate(Object feature) { String varName = getExpression(0).evaluate(feature, String.class); Object value = localLookup.getTable().get(varName.toUpperCase()); if (value == null) { value = globalLookup.get(varName.toUpperCase()); } if (value == null) { final int paramSize = getParameters().size(); if (paramSize > NAME.getArgumentCount()) { value = getExpression(paramSize - 1).evaluate(feature); } } return value; } EnvFunction(); static void setLocalValues(Map<String, Object> values); static Map<String, Object> getLocalValues(); static void clearLocalValues(); static void setGlobalValues(Map<String, Object> values); static void clearGlobalValues(); static void setLocalValue(String name, Object value); static void removeLocalValue(String name); static void setGlobalValue(String name, Object value); static void removeGlobalValue(String name); @Override Object evaluate(Object feature); @Override void setParameters(List params); @Override void setFallbackValue(Literal fallback); }
EnvFunction extends FunctionExpressionImpl { @Override public Object evaluate(Object feature) { String varName = getExpression(0).evaluate(feature, String.class); Object value = localLookup.getTable().get(varName.toUpperCase()); if (value == null) { value = globalLookup.get(varName.toUpperCase()); } if (value == null) { final int paramSize = getParameters().size(); if (paramSize > NAME.getArgumentCount()) { value = getExpression(paramSize - 1).evaluate(feature); } } return value; } EnvFunction(); static void setLocalValues(Map<String, Object> values); static Map<String, Object> getLocalValues(); static void clearLocalValues(); static void setGlobalValues(Map<String, Object> values); static void clearGlobalValues(); static void setLocalValue(String name, Object value); static void removeLocalValue(String name); static void setGlobalValue(String name, Object value); static void removeGlobalValue(String name); @Override Object evaluate(Object feature); @Override void setParameters(List params); @Override void setFallbackValue(Literal fallback); static FunctionName NAME; }