Purpose of adding single quote to string value of literal expression #2436
omarsilva1
started this conversation in
General
Replies: 1 comment
-
Because toString() returns a representation of the expression, not its typed value. Downcasting and calling value() will return the typed value. The quote should be a wrapped single quote though: return "'" + value + "'"; |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone, I would like to know what the purpose is of adding a single quote to the toString method (for LiteralExpressions). I would have expected the return type to be just the value as a string or something like
"LiteralExpression: " + value
or the value wrapped around single quotes. I got confused when comparing the left expression values of policies (before I realized to cast to LiteralExpression and usevalue()
), I would think others could make the same mistake.Maybe you can tell me more, @jimmarino?
Connector/spi/common/policy-model/src/main/java/org/eclipse/edc/policy/model/LiteralExpression.java
Lines 36 to 39 in c2bc86f
Beta Was this translation helpful? Give feedback.
All reactions