Does jackson (Java) provide a get-in
equivalent for lookup on a JsonNode
?
In case anyone else are interested, I just wrote it out:
JsonNode current = this.provideJson.get();
for (String k : key) {
if (current.hasNonNull(k)) {
current = current.get(k);
} else {
return Optional.empty();
}
}
if (current.isInt())
return Optional.of(current.asInt());
else
return Optional.empty();
Quite straightforward.Different methods for different types. I didn't bother with generics.
JsonNode#at
is it’s built-in equivalent
Thanks!
JetBrains editors have “Extend Selection” + cut/copy/paste and it is a reasonable compromise. It’s not real structural editing, but you get perhaps ~50% of the same effect.
I had to write a bit of Swift and Xcode does not have “Extend Selection” or anything similar. I used JetBrains AppCode, which does. I recommend it for Swift/Objective-C.