Search in sources :

Example 1 with API_endpointDTO

use of org.wso2.carbon.apimgt.rest.api.publisher.dto.API_endpointDTO in project carbon-apimgt by wso2.

the class MappingUtil method fromEndpointToList.

private static List<API_endpointDTO> fromEndpointToList(Map<String, Endpoint> endpoint) throws IOException {
    List<API_endpointDTO> endpointDTOs = new ArrayList<>();
    if (endpoint != null) {
        for (Map.Entry<String, Endpoint> entry : endpoint.entrySet()) {
            API_endpointDTO endpointDTO = new API_endpointDTO();
            if (APIMgtConstants.API_SPECIFIC_ENDPOINT.equals(entry.getValue().getApplicableLevel())) {
                endpointDTO.setInline(toEndPointDTO(entry.getValue()));
            } else {
                endpointDTO.setKey(entry.getValue().getId());
            }
            endpointDTO.setType(entry.getKey());
            endpointDTOs.add(endpointDTO);
        }
    }
    return endpointDTOs;
}
Also used : Endpoint(org.wso2.carbon.apimgt.core.models.Endpoint) ArrayList(java.util.ArrayList) Map(java.util.Map) HashMap(java.util.HashMap) API_endpointDTO(org.wso2.carbon.apimgt.rest.api.publisher.dto.API_endpointDTO)

Aggregations

ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 Endpoint (org.wso2.carbon.apimgt.core.models.Endpoint)1 API_endpointDTO (org.wso2.carbon.apimgt.rest.api.publisher.dto.API_endpointDTO)1