RouterInfo: Add convenience method getVersion()

This commit is contained in:
zzz
2014-12-02 13:30:31 +00:00
parent f1e9f5d4fd
commit 4b2715c36f

View File

@@ -261,6 +261,18 @@ public class RouterInfo extends DatabaseEntry {
return _options.getProperty(opt);
}
/**
* For convenience, the same as getOption("router.version"),
* but returns "0" if unset.
*
* @return non-null, "0" if unknown.
* @since 0.9.18
*/
public String getVersion() {
String rv = _options.getProperty("router.version");
return rv != null ? rv : "0";
}
/**
* Configure a set of options or statistics that the router can expose.
* Makes a copy.