Created
April 4, 2014 14:33
-
-
Save dkuppitz/9975869 to your computer and use it in GitHub Desktop.
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
class EnhancedVertex { | |
static void setOrRemoveProperty(final Vertex self, final String property, final def value) { | |
if (value == null) self.removeProperty(property) else self.setProperty(property, value) | |
} | |
} | |
g = TinkerGraphFactory.createTinkerGraph() | |
use (EnhancedVertex) { | |
marko = g.v(1) | |
marko.setOrRemoveProperty("foo", "bar") | |
marko.setOrRemoveProperty("name", null) | |
} | |
g.(1).map() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I had no idea you could do that. Thanks!