Last active
November 18, 2016 18:16
-
-
Save amolbrid/ee2fde0c2c63dbdc44f59ddc5bb6c35c to your computer and use it in GitHub Desktop.
ArrayCompose with constant
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String json = "{\"name\":\"abc\", \"active\":false}"; | |
StartFunction start = new StartFunction(); | |
ConstantFunction constFun1 = new ConstantFunction(JsonNodeFactory.instance.textNode("const1")); | |
ConstantFunction constFun2 = new ConstantFunction(JsonNodeFactory.instance.textNode("const1")); | |
ReadPropertyFunction read = new ReadPropertyFunction("name"); | |
ReadPropertyFunction readActive = new ReadPropertyFunction("active"); | |
EqualsFunction eql = new EqualsFunction("true"); | |
ArrayComposeFunction arrayCompose = new ArrayComposeFunction(); | |
PrintFunction print = new PrintFunction(); | |
start.addDependent(constFun1).addDependent(arrayCompose).addDependent(print); | |
start.addDependent(constFun2).addDependent(arrayCompose); | |
start.addDependent(readActive).addDependent(eql).addDependent(read).addDependent(arrayCompose); | |
ObjectMapper mapper = new ObjectMapper(); | |
JsonNode node = mapper.readTree(json); | |
Context context = new Context(node); | |
ExecutorFunction function = new ExecutorFunction(start); | |
function.apply(context, node); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment