public static List<MetricDto> transformToDto(List<Metric> metrics){
  if (metrics == null) {
    throw new WebApplicationException("Null entity object cannot be converted to Dto object.",Status.INTERNAL_SERVER_ERROR);
  }
  List<MetricDto> result=new ArrayList<>();
  for (  Metric metric : metrics) {
    result.add(transformToDto(metric));
  }
  return result;
}

public static List < MetricDto > transformToDto ( List < Metric > metrics ) { if ( metrics == null ) { throw new WebApplicationException ( "Null entity object cannot be converted to Dto object." , Status . INTERNAL_SERVER_ERROR ) ; } List < MetricDto > result = new ArrayList < > ( ) ; for ( Metric metric : metrics ) { result . add ( transformToDto ( metric ) ) ; } return result ; }
converts list of alert entity objects to list of alertdto objects .
