package com.casic.PgInterface.devTable.dto;

import com.casic.PgInterface.devTable.domain.PgRoad;

import java.util.ArrayList;
import java.util.List;

public class PgPipeLineRoadStatic {

    private String road;
    private List<PgPipeLineLengthStatic> pgPipeLineLengthStaticList;

    public String getRoad() {
        return road;
    }

    public void setRoad(String road) {
        this.road = road;
    }

    public List<PgPipeLineLengthStatic> getPgPipeLineLengthStaticList() {
        return pgPipeLineLengthStaticList;
    }

    public void setPgPipeLineLengthStaticList(List<PgPipeLineLengthStatic> pgPipeLineLengthStaticList) {
        this.pgPipeLineLengthStaticList = pgPipeLineLengthStaticList;
    }

    public static List<PgPipeLineRoadStatic> getPgPipeLineRoadStaticList(List<PgRoad> pgRoadList){

        List<PgPipeLineRoadStatic> pgPipeLineRoadStaticList=new ArrayList<>();

        for(PgRoad pgRoad:pgRoadList){
            PgPipeLineRoadStatic pgPipeLineRoadStatic=new PgPipeLineRoadStatic();

            pgPipeLineRoadStatic.setRoad(pgRoad.getRoadName());
            pgPipeLineRoadStatic.pgPipeLineLengthStaticList=new ArrayList<>();

            pgPipeLineRoadStaticList.add(pgPipeLineRoadStatic);
        }

        return pgPipeLineRoadStaticList;
    }

}
