Fabio Sinibaldi 2017-12-13 18:12:08 +00:00
parent 78cf6a5806
commit 0c51632694
2 changed files with 14 additions and 0 deletions

View File

@ -33,4 +33,17 @@ public class ThreddsInfo {
private int build;
private int revision;
private String ghnId;
public ThreddsCatalog getById(String id) {
return findById(catalog,id);
}
private static ThreddsCatalog findById(ThreddsCatalog catalog,String id) {
if(catalog==null||catalog.getID()==null||catalog.getID().equals(id)) return catalog;
for(ThreddsCatalog cat : catalog.getSubCatalogs().getLinkedCatalogs())
return findById(cat,id);
return null;
}
}

View File

@ -289,6 +289,7 @@ public class MarshallUnmarshalTest {
mainCatalog.setSubCatalogs(collection);
info.setCatalog(mainCatalog);
info.getById(subCatalog.getID());
return info;
}