use of com.google.api.server.spi.config.ApiMetricCost in project endpoints-java by cloudendpoints.
the class ApiMethodAnnotationConfig method setMetricCosts.
public void setMetricCosts(ApiMetricCost[] metricCosts) {
ImmutableList.Builder<ApiMetricCostConfig> costs = ImmutableList.builder();
if (metricCosts != null && metricCosts.length > 0) {
for (ApiMetricCost cost : metricCosts) {
costs.add(ApiMetricCostConfig.builder().setName(cost.name()).setCost(cost.cost()).build());
}
}
config.setMetricCosts(costs.build());
}
Aggregations