use of org.wso2.carbon.apimgt.rest.api.publisher.v1.dto.MonetizationAttributeDTO in project carbon-apimgt by wso2.
the class SettingsMappingUtil method getMonetizationAttributes.
/**
* This method returns the monetization properties from configuration.
*
* @return List<String> monetization properties
* @throws APIManagementException
*/
private List<MonetizationAttributeDTO> getMonetizationAttributes() {
List<MonetizationAttributeDTO> monetizationAttributeDTOSList = new ArrayList<MonetizationAttributeDTO>();
JSONArray monetizationAttributes = APIUtil.getMonetizationAttributes();
for (int i = 0; i < monetizationAttributes.size(); i++) {
JSONObject monetizationAttribute = (JSONObject) monetizationAttributes.get(i);
MonetizationAttributeDTO monetizationAttributeDTO = new MonetizationAttributeDTO();
monetizationAttributeDTO.setName((String) monetizationAttribute.get(APIConstants.Monetization.ATTRIBUTE));
monetizationAttributeDTO.setDisplayName((String) monetizationAttribute.get(APIConstants.Monetization.ATTRIBUTE_DISPLAY_NAME));
monetizationAttributeDTO.setDescription((String) monetizationAttribute.get(APIConstants.Monetization.ATTRIBUTE_DESCRIPTION));
monetizationAttributeDTO.setRequired((Boolean) monetizationAttribute.get(APIConstants.Monetization.IS_ATTRIBITE_REQUIRED));
monetizationAttributeDTO.setHidden((Boolean) monetizationAttribute.get(APIConstants.Monetization.IS_ATTRIBUTE_HIDDEN));
monetizationAttributeDTOSList.add(monetizationAttributeDTO);
}
return monetizationAttributeDTOSList;
}
Aggregations