Search in sources :

Example 1 with InterfacesSelectApiData

use of org.eclipse.winery.repository.rest.resources.apiData.InterfacesSelectApiData in project winery by eclipse.

the class InterfacesResource method onGet.

@GET
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
public List<?> onGet(@QueryParam("selectData") String selectData) {
    if (selectData == null) {
        return this.interfaces;
    }
    List<InterfacesSelectApiData> list = new ArrayList<>();
    for (TInterface item : this.interfaces) {
        List<String> ops = new ArrayList<>();
        for (TOperation op : item.getOperation()) {
            ops.add(op.getName());
        }
        list.add(new InterfacesSelectApiData(item.getName(), ops));
    }
    return list;
}
Also used : InterfacesSelectApiData(org.eclipse.winery.repository.rest.resources.apiData.InterfacesSelectApiData) TInterface(org.eclipse.winery.model.tosca.TInterface) TOperation(org.eclipse.winery.model.tosca.TOperation) ArrayList(java.util.ArrayList)

Aggregations

ArrayList (java.util.ArrayList)1 TInterface (org.eclipse.winery.model.tosca.TInterface)1 TOperation (org.eclipse.winery.model.tosca.TOperation)1 InterfacesSelectApiData (org.eclipse.winery.repository.rest.resources.apiData.InterfacesSelectApiData)1