package kr.gmtc.tss.data.vo;

import java.time.LocalDateTime;
import java.time.ZoneOffset;

import com.fasterxml.jackson.annotation.JsonProperty;

public class StandStatusVO implements Comparable<StandStatusVO> {

	private boolean inserted=false;
	
	public long timeStamp = LocalDateTime.now().toInstant(ZoneOffset.ofHours(9)).toEpochMilli();
	
	public StandStatusVO() {
	}

	protected LocalDateTime dateTime;
	
	@JsonProperty("stand_no")
	private String standNo;  
	@JsonProperty("stand_sttus_ty")
	private StandSttusTy standSttusTy; 	//AI 주기장 상황 분석 유형(공통코드-CT038)
	@JsonProperty("aircraft_sttus_ty")
	private String aircraftSttusTy; //주기장 항공기 상태 타입(공통코드-CT019)
	private String clsgn; 
	
	@Override
	public String toString() {
		return "StandStatusVO [inserted=" + inserted + ", timeStamp=" + timeStamp + ", dateTime=" + dateTime
				+ ", standNo=" + standNo + ", standSttusTy=" + standSttusTy.toString() + ", aircraftSttusTy=" + aircraftSttusTy
				+ ", clsgn=" + clsgn + "]";
	}

	public boolean isInserted() {
		return inserted;
	}

	public void setInserted(boolean inserted) {
		this.inserted = inserted;
	}

	public long getTimeStamp() {
		return timeStamp;
	}

	public void setTimeStamp(long timeStamp) {
		this.timeStamp = timeStamp;
	}

	public LocalDateTime getDateTime() {
		return dateTime;
	}

	public void setDateTime(LocalDateTime dateTime) {
		this.dateTime = dateTime;
	}
	
	public String getStandNo() {
		return standNo;
	}

	public void setStandNo(String standNo) {
		this.standNo = standNo;
	}

	public String getClsgn() {
		return clsgn;
	}

	public void setClsgn(String clsgn) {
		this.clsgn = clsgn;
	}

	public StandSttusTy getStandSttusTy() {
		return standSttusTy;
	}

	public void setStandSttusTy(StandSttusTy standSttusTy) {
		this.standSttusTy = standSttusTy;
	}

	public String getAircraftSttusTy() {
		return aircraftSttusTy;
	}

	public void setAircraftSttusTy(String aircraftSttusTy) {
		this.aircraftSttusTy = aircraftSttusTy;
	}

	@Override
    public boolean equals(Object obj) {
        //p1.equals(p2)
        if(obj instanceof StandStatusVO) {
        	StandStatusVO p = (StandStatusVO)obj;
            return this.hashCode()==p.hashCode(); 
            
        }
        return false;
    }

	@Override
	public int compareTo(StandStatusVO o) {
		return 0;
	}
	
	public static class StandSttusTy {
		@JsonProperty("arcft_stand")
        private String arcrftStnd;
		@JsonProperty("brdg_cnnctd")
        private String brdgCnnctd;
		@JsonProperty("crg_dr_opnd")
        private String crgDrOpnd;
		@JsonProperty("pad_clear")
        private String padClear;
		@JsonProperty("twng_cr_cnnctd")
        private String twngCrCnnctd;
		public String getArcrftStnd() {
			return arcrftStnd;
		}
		public void setArcrftStnd(String arcrftStnd) {
			this.arcrftStnd = arcrftStnd;
		}
		public String getBrdgCnnctd() {
			return brdgCnnctd;
		}
		public void setBrdgCnnctd(String brdgCnnctd) {
			this.brdgCnnctd = brdgCnnctd;
		}
		public String getCrgDrOpnd() {
			return crgDrOpnd;
		}
		public void setCrgDrOpnd(String crgDrOpnd) {
			this.crgDrOpnd = crgDrOpnd;
		}
		public String getPadClear() {
			return padClear;
		}
		public void setPadClear(String padClear) {
			this.padClear = padClear;
		}
		public String getTwngCrCnnctd() {
			return twngCrCnnctd;
		}
		public void setTwngCrCnnctd(String twngCrCnnctd) {
			this.twngCrCnnctd = twngCrCnnctd;
		}
		
		@Override
		public String toString() {
			return "StandSttusTy [arcrftStnd=" + arcrftStnd + ", brdgCnnctd=" + brdgCnnctd + ", crgDrOpnd=" + crgDrOpnd
					+ ", padClear=" + padClear + ", twngCrCnnctd=" + twngCrCnnctd + "]";
		}
		
		public String toDataFormat() {
			return arcrftStnd+"@"+brdgCnnctd+"@"+crgDrOpnd+"@"+padClear+"@"+twngCrCnnctd;
		}
	}
}
