package cgmblelib.custom.livedata.scan;

import java.io.Serializable;

import cgmblelib.database.entity.PocDevice;

public class PocDeviceAndRssi implements Serializable, Comparable<PocDeviceAndRssi>{

    private PocDevice pocDevice;
    private int rssi;
    //点了item之后图片转圈圈
    private int checkedPostion = -1;


    public PocDevice getPocDevice() {
        return pocDevice;
    }

    public void setPocDevice(PocDevice pocDevice) {
        this.pocDevice = pocDevice;
    }

    public int getRssi() {
        return rssi;
    }

    public void setRssi(int rssi) {
        this.rssi = rssi;
    }

    public int getCheckedPostion() {
        return checkedPostion;
    }

    public void setCheckedPostion(int checkedPostion) {
        this.checkedPostion = checkedPostion;
    }

    public PocDeviceAndRssi(PocDevice pocDevice, int rssi) {
        this.pocDevice = pocDevice;
        this.rssi = rssi;
    }

    @Override
    public int compareTo(PocDeviceAndRssi o) {
        return Math.abs(this.rssi)- Math.abs(o.rssi);
    }

    @Override
    public String toString() {
        return "PocDeviceAndRssi{" +
                "pocDevice=" + pocDevice +
                ", rssi=" + rssi +
                ", checkedPostion=" + checkedPostion +
                '}';
    }
}
