package cn.cecep.talroad.data.analyse.task.entity;

import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;
import java.util.stream.Collectors;

/***
 *
 * @Title:
 * @Author: xuxin
 * @CreateTime: 2023-07-03 10:25
 * @Description
 *
 **/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class PollutantEntity {

    @ApiModelProperty("属性名称")
    private String propName;

    @ApiModelProperty("污染物代码")
    private String pollutantsCode;

    @ApiModelProperty("污染物名称")
    private String pollutantsName;

    public static List<String> getAllProp(List<PollutantEntity> pollutantEntities){
        return pollutantEntities.stream().map(PollutantEntity::getPropName).collect(Collectors.toList());
    }

    public static List<String> getAllPollCode(List<PollutantEntity> pollutantEntities){
        return pollutantEntities.stream().map(PollutantEntity::getPollutantsCode).collect(Collectors.toList());
    }

}
