package com.casic.PgInterface.devTable.dto;

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

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

public class PgRoadDto{

    private long id;
    private String roadName;
    private String active;

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getRoadName() {
        return roadName;
    }

    public void setRoadName(String roadName) {
        this.roadName = roadName;
    }

    public String getActive() {
        return active;
    }

    public void setActive(String active) {
        this.active = active;
    }

    public static PgRoadDto ConvertToDTO(PgRoad pgRoad){
        PgRoadDto pgRoadDto=new PgRoadDto();
        pgRoadDto.setId(pgRoad.getId());
        pgRoadDto.setRoadName(pgRoad.getRoadName());
        pgRoadDto.setActive(String.valueOf(pgRoad.getActive()));

        return pgRoadDto;
    }

    public static List<PgRoadDto> ConvertToDTOList(List<PgRoad> pgRoadList){
        List<PgRoadDto> pgRoadDtoList=new ArrayList<PgRoadDto>();
        for(PgRoad pgRoad:pgRoadList){
            pgRoadDtoList.add(ConvertToDTO(pgRoad));
        }

        return pgRoadDtoList;
    }

}