use of org.wso2.carbon.apimgt.rest.api.publisher.v1.dto.GraphQLSchemaTypeDTO in project carbon-apimgt by wso2.
the class GraphqlQueryAnalysisMappingUtil method fromGraphqlSchemaTypeListtoDTO.
/**
* Converts a list of GraphqlSchemaType objects into a DTO object.
*
* @param typeList List<GraphqlSchemaType>
* @return a new GraphQLSchemaTypeListDTO object corresponding to given list of GraphqlSchemaType objects
*/
public static GraphQLSchemaTypeListDTO fromGraphqlSchemaTypeListtoDTO(List<GraphqlSchemaType> typeList) {
GraphQLSchemaTypeListDTO graphQLSchemaTypeListDTO = new GraphQLSchemaTypeListDTO();
List<GraphQLSchemaTypeDTO> graphQLSchemaTypeDTOList = new ArrayList<>();
for (GraphqlSchemaType graphqlSchemaType : typeList) {
GraphQLSchemaTypeDTO graphQLSchemaTypeDTO = new GraphQLSchemaTypeDTO();
List<String> fieldList = new ArrayList<>(graphqlSchemaType.getFieldList());
graphQLSchemaTypeDTO.setType(graphqlSchemaType.getType());
graphQLSchemaTypeDTO.setFieldList(fieldList);
graphQLSchemaTypeDTOList.add(graphQLSchemaTypeDTO);
}
graphQLSchemaTypeListDTO.setTypeList(graphQLSchemaTypeDTOList);
return graphQLSchemaTypeListDTO;
}
Aggregations