Search in sources :

Example 1 with UntypedItemCollection

use of org.platformlayer.common.UntypedItemCollection in project platformlayer by platformlayer.

the class PlatformLayerClientBase method listItems.

@Override
public <T> List<T> listItems(Class<T> clazz) throws OpsException {
    JaxbHelper jaxbHelper = PlatformLayerClientBase.toJaxbHelper(clazz, ManagedItemCollection.class);
    PlatformLayerKey path = PlatformLayerClientBase.toKey(jaxbHelper, null, listServices(true));
    UntypedItemCollection untypedItems = listItemsUntyped(path);
    List<T> items = Lists.newArrayList();
    for (UntypedItem untypedItem : untypedItems.getItems()) {
        T item = promoteToTyped(untypedItem, clazz);
        items.add(item);
    }
    return items;
}
Also used : UntypedItem(org.platformlayer.common.UntypedItem) JaxbHelper(org.platformlayer.xml.JaxbHelper) UntypedItemCollection(org.platformlayer.common.UntypedItemCollection) PlatformLayerKey(org.platformlayer.core.model.PlatformLayerKey)

Aggregations

UntypedItem (org.platformlayer.common.UntypedItem)1 UntypedItemCollection (org.platformlayer.common.UntypedItemCollection)1 PlatformLayerKey (org.platformlayer.core.model.PlatformLayerKey)1 JaxbHelper (org.platformlayer.xml.JaxbHelper)1