Skip to content

Instantly share code, notes, and snippets.

@stormwy
Last active August 9, 2019 07:11
Show Gist options
  • Select an option

  • Save stormwy/3afd0649d97ed3c248a352ef2cdfef41 to your computer and use it in GitHub Desktop.

Select an option

Save stormwy/3afd0649d97ed3c248a352ef2cdfef41 to your computer and use it in GitHub Desktop.
[java] aviator example
import com.googlecode.aviator.AviatorEvaluator;
import com.googlecode.aviator.Expression;
import java.util.HashMap;
import java.util.Map;
public class TestAviator {
public static void main(String[] args) {
Expression compiledExp = AviatorEvaluator.compile("100<a && a<200",true);
Map<String,Object> factorMap = new HashMap<>();
factorMap.put("a",300);
System.out.println(compiledExp.execute(factorMap));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment