Update README.md

Explained the use of maps slightly better.
This commit is contained in:
Gideon le Grange 2014-11-11 03:24:00 +02:00
parent 0c48b49f23
commit 882503b602
1 changed files with 8 additions and 0 deletions

View File

@ -85,6 +85,14 @@ for (Map<String,String> 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<String, String> map : rs) {
System.out.println(map.get("name"));
}
```
### Filtering results
The same query, but with the results filtered: Print all interfaces of type 'vlan'.