Package org.metricshub.winrm
Class WqlResult
java.lang.Object
org.metricshub.winrm.WqlResult
The complete result of a WQL query: the rows, the column names in query order, and the
time the query took. Iterable, so it can be consumed directly:
for (WqlRow row : client.wql("SELECT Name, State FROM Win32_Service").execute()) {
System.out.println(row.string("Name"));
}
-
Method Summary
Modifier and TypeMethodDescriptioncolumns()Get the column names, in the order they appear in the WQL query (SELECT *yields the order the server returned).elapsed()Get the time the query took, from request to complete result.booleanisEmpty()Whether the query returned no rows.iterator()rows()Get the result rows.intsize()Get the number of rows.toString()Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
columns
Get the column names, in the order they appear in the WQL query (SELECT *yields the order the server returned).- Returns:
- an unmodifiable list of column names
-
rows
Get the result rows.- Returns:
- an unmodifiable list of rows
-
size
public int size()Get the number of rows.- Returns:
- the row count
-
isEmpty
public boolean isEmpty()Whether the query returned no rows.- Returns:
truewhen the result is empty
-
elapsed
Get the time the query took, from request to complete result.- Returns:
- the elapsed time
-
iterator
-
toString
-