use of io.gravitee.rest.api.model.PolicyDevelopmentEntity in project gravitee-management-rest-api by gravitee-io.
the class PoliciesResource method convert.
private PolicyListItem convert(PolicyEntity policy) {
PolicyListItem item = new PolicyListItem();
item.setId(policy.getId());
item.setName(policy.getName());
item.setDescription(policy.getDescription());
item.setVersion(policy.getVersion());
item.setType(policy.getType());
item.setCategory(policy.getCategory());
PolicyDevelopmentEntity development = policy.getDevelopment();
if (development != null) {
item.setOnRequest(development.getOnRequestMethod() != null);
item.setOnResponse(development.getOnResponseMethod() != null);
} else {
item.setOnRequest(false);
item.setOnResponse(false);
}
return item;
}
Aggregations