package com.casic.PgInterface.overtimeInPG.dto;

import com.casic.PgInterface.overtimeInPG.domain.PGTagPositionView;

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

public class PGPositionSimpleDto {

    private String Y;
    private String partition;
    private String binName;
    private String positionUpdateTime;
    private String coordinatesName;
    private long id;

    private String X;

    public long getId() {
        return id;
    }

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

    public String getX() {
        return X;
    }

    public void setX(String x) {
        X = x;
    }

    public String getY() {
        return Y;
    }

    public void setY(String y) {
        Y = y;
    }

    public String getPartition() {
        return partition;
    }

    public void setPartition(String partition) {
        this.partition = partition;
    }

    public String getBinName() {
        return binName;
    }

    public void setBinName(String binName) {
        this.binName = binName;
    }

    public String getPositionUpdateTime() {
        return positionUpdateTime;
    }

    public void setPositionUpdateTime(String positionUpdateTime) {
        this.positionUpdateTime = positionUpdateTime;
    }

    public String getCoordinatesName() {
        return coordinatesName;
    }

    public void setCoordinatesName(String coordinatesName) {
        this.coordinatesName = coordinatesName;
    }

    public static PGPositionSimpleDto Convert2Simple (PGTagPositionView pgTagPositionView)
    {
        PGPositionSimpleDto pgPositionSimpleDto = new PGPositionSimpleDto();
        pgPositionSimpleDto.setBinName(pgTagPositionView.getBinName());
        pgPositionSimpleDto.setCoordinatesName(pgTagPositionView.getCoordinatesName());
        pgPositionSimpleDto.setId(pgTagPositionView.getId());
        pgPositionSimpleDto.setPartition(pgTagPositionView.getPartition());
        pgPositionSimpleDto.setPositionUpdateTime(pgTagPositionView.getPositionUpdateTime());
        pgPositionSimpleDto.setX(pgTagPositionView.getX());
        pgPositionSimpleDto.setY(pgTagPositionView.getY());
        return pgPositionSimpleDto;
    }

    public static List<PGPositionSimpleDto> Conver2SimpleList(List<PGTagPositionView> pgTagPositionViewList){
        List<PGPositionSimpleDto> pgPositionSimpleDtoList = new ArrayList<>();
        for (PGTagPositionView pgTagPositionView : pgTagPositionViewList)
            pgPositionSimpleDtoList.add(Convert2Simple(pgTagPositionView));
        return pgPositionSimpleDtoList;
    }




}
