s = stringCache.get("S"); // - " -
s = stringCache.get("A"); // note: loader used
}
private static void tipuApiClient_and_TipuApiResource_and_DocumentNode_Example() {
TipuAPIClient api = null;
try {
api = new TipuAPIClientImple("https://h92.it.helsinki.fi/tipu-api", "tipuapi", "Barca4Valencia5Madrid6");
TipuApiResource r = api.get(TipuAPIClient.SPECIES);
Node helmipollo = r.getById("AEGFUN");
String nimi_suomi = helmipollo.getNode("name").getContents();
assert(nimi_suomi.equals("Helmipöllö"));
String nimi_latina = "";
for (Node n : helmipollo.getChildNodes("name")) {
if (n.getAttribute("lang").equals("LA")) {
nimi_latina = n.getContents();
break;
}
}
assert(nimi_latina.equals("Aegolius funereus"));
} catch (Exception e) {
e.printStackTrace();
} finally {
if (api != null) api.close();
}
}