RealCarPark.java 1.94 KB
package com.bsth.entity.real;

/**
 * 实时场内车辆停放情况
 * Created by panzhao on 2017/9/14.
 */
public class RealCarPark {

    /**
     * 车辆类型
     * 0 公交车
     * 1 小车
     * 2 其他
     */
    private int type;

    /**
     * 公交车车辆自编号
     */
    private String nbbm;

    /**
     * 车牌号
     */
    private String plateNo;

    /**
     * 进场时间
     */
    private Long inTime;

    /**
     * 停放泊位名称
     */
    private String berthName;

    /**
     * 实时电量
     */
    private String soc;


    public String getNbbm() {
        return nbbm;
    }

    public void setNbbm(String nbbm) {
        this.nbbm = nbbm;
    }

    public String getPlateNo() {
        return plateNo;
    }

    public void setPlateNo(String plateNo) {
        this.plateNo = plateNo;
    }

    public Long getInTime() {
        return inTime;
    }

    public void setInTime(Long inTime) {
        this.inTime = inTime;
    }

    public String getBerthName() {
        return berthName;
    }

    public void setBerthName(String berthName) {
        this.berthName = berthName;
    }

    public String getSoc() {
        return soc;
    }

    public void setSoc(String soc) {
        this.soc = soc;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    @Override
    public int hashCode() {
        return toString().hashCode();
    }

    @Override
    public boolean equals(Object obj) {
        RealCarPark rcp = (RealCarPark) obj;
        if(this.getType() != rcp.getType())
            return false;
        else{
            if(this.getNbbm().equals(rcp.getNbbm()) || this.getPlateNo().equals(rcp.getPlateNo()))
                return true;
        }
        return super.equals(obj);
    }

    @Override
    public String toString() {
        return this.getType() + "_" + this.getNbbm() + "_" + this.getPlateNo();
    }
}