Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please restore default values to call to get a node's property #172

Closed
crichey opened this issue May 9, 2016 · 3 comments
Closed

Please restore default values to call to get a node's property #172

crichey opened this issue May 9, 2016 · 3 comments

Comments

@crichey
Copy link

crichey commented May 9, 2016

With Neo3 and bolt the method for getting a property value from a node lost the ability to set a default value in case the property doesn’t exist in the node. That was a VERY useful feature. With the current implementation you end up taking code that effectively was (prior to Bolt) as simple and clear as:
String myValue = node.get(“myValue”,””)
to

String myValue = “"
if(node.containsKey(“myValue”)) { myValue = node.get(“myValue”).asString()}

Obviously its not a huge deal if you have to do it once, but when you have to do it frequently (as I am when migrating 2.3 code to bolt) then it is a bit of a pain and a source of potential errors.

@technige
Copy link
Contributor

technige commented May 9, 2016

Thanks for the feedback. That would indeed be a useful addition to the API.

@technige
Copy link
Contributor

We have added this to our TODO list for implementation.

@zhenlineo
Copy link
Contributor

I am closing this issue as the changes already included with the new release 1.1.0-M02

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants