Skip to content

Instantly share code, notes, and snippets.

@jpablo
Created October 13, 2012 16:04
Show Gist options
  • Save jpablo/3885136 to your computer and use it in GitHub Desktop.
Save jpablo/3885136 to your computer and use it in GitHub Desktop.
java "map"
import com.google.common.collect.Iterables;
// ...
Iterable<String> items = Iterables.transform(getNodes("/List/Item", document),
new Function<Node, String>() {
public String apply(@Nullable Node node) {
//noinspection ConstantConditions
return node.getTextContent();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment