From 882503b602b2fd3921f2dc55213f28ad9ec29d27 Mon Sep 17 00:00:00 2001 From: Gideon le Grange Date: Tue, 11 Nov 2014 03:24:00 +0200 Subject: [PATCH] Update README.md Explained the use of maps slightly better. --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 04e13d7..ddf52d9 100644 --- a/README.md +++ b/README.md @@ -85,6 +85,14 @@ for (Map r : rs) { } ``` +Results are returned as a list of maps of String key/value pairs. The reason for this is that a command can return multiple results, which have multpile variables. For example, to print the names of all the interfaces returned in the command above, do: + +```java +for (Map map : rs) { + System.out.println(map.get("name")); +} +``` + ### Filtering results The same query, but with the results filtered: Print all interfaces of type 'vlan'.