Conversation
indrajra
approved these changes
Mar 21, 2019
Collaborator
There was a problem hiding this comment.
The toString here can still make 7 as "7", which is why we needed some other way.
Owner
Author
There was a problem hiding this comment.
Now, JsonNodeFactory.instance.pojoNode(evaluator.evaluate()) using to set the object.
indrajra
approved these changes
Mar 21, 2019
| @Before | ||
| public void init() { | ||
| vt = new ViewTemplate(); | ||
| FunctionDefinition fd = new FunctionDefinition(); |
Collaborator
There was a problem hiding this comment.
Could there be a parameterized constructor?
| String mathProblem = "{\"Math\": " + | ||
| " {\"a\": 5," + | ||
| " \"b\": 2 }}"; | ||
| ObjectNode node = (ObjectNode) new ObjectMapper().readTree(mathProblem); |
Collaborator
There was a problem hiding this comment.
this is duplicate code repeated in tests...if you've to add a third test, you must think of creating functions for this.
indrajra
requested changes
Mar 25, 2019
Collaborator
indrajra
left a comment
There was a problem hiding this comment.
Can't allow EvaluatorFactory to be hardcoded with function names.
|
|
||
| public class EvaluatorFactory { | ||
|
|
||
| public static final String concat = "concat"; |
Collaborator
There was a problem hiding this comment.
MANDATORY: Why are these hardcoded here? We are creating a library and this can't be in a Factory class for sure.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part1 changes done:
Introduced new methods to
Modified transformer method
Added test cases
deleted VTMain
Part 2 changes done-
Introduced IEvaluator: public T evaluate() and EvaluatorFactory: getInstance()