IT-KIMI_SHI\SINOIT.KIMI
2018-06-04 b12dfac6e495d6cf38df6b7e5222191f59762900
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
package console;
 
import java.io.Serializable;
import java.util.Objects;
 
/**
 * Created by Administrator on 2018/5/7.
 */
 
public class BeaconModel implements Serializable{
    private String name;
    private int major;
    private int minor;
    private String proximityUuid;
    private String bluetoothAddress;
    private int txPower;
    private int rssi;
    private String mac;
    private double distance;
    public  BeaconModel(){}
 
    public BeaconModel(String name, int major, int minor, String proximityUuid, String bluetoothAddress, int txPower, int rssi, String mac, double distance) {
        this.name = name;
        this.major = major;
        this.minor = minor;
        this.proximityUuid = proximityUuid;
        this.bluetoothAddress = bluetoothAddress;
        this.txPower = txPower;
        this.rssi = rssi;
        this.mac = mac;
        this.distance = distance;
    }
 
    public BeaconModel(String name, int major, int minor, String proximityUuid, String bluetoothAddress, int txPower, int rssi) {
        this.name = name;
        this.major = major;
        this.minor = minor;
        this.proximityUuid = proximityUuid;
        this.bluetoothAddress = bluetoothAddress;
        this.txPower = txPower;
        this.rssi = rssi;
    }
 
    public String getName() {
        return name;
    }
 
    public void setName(String name) {
        this.name = name;
    }
 
    public int getMajor() {
        return major;
    }
 
    public void setMajor(int major) {
        this.major = major;
    }
 
    public int getMinor() {
        return minor;
    }
 
    public void setMinor(int minor) {
        this.minor = minor;
    }
 
    public String getProximityUuid() {
        return proximityUuid;
    }
 
    public void setProximityUuid(String proximityUuid) {
        this.proximityUuid = proximityUuid;
    }
 
    public String getBluetoothAddress() {
        return bluetoothAddress;
    }
 
    public void setBluetoothAddress(String bluetoothAddress) {
        this.bluetoothAddress = bluetoothAddress;
    }
 
    public int getTxPower() {
        return txPower;
    }
 
    public void setTxPower(int txPower) {
        this.txPower = txPower;
    }
 
    public int getRssi() {
        return rssi;
    }
 
    public void setRssi(int rssi) {
        this.rssi = rssi;
    }
 
    public String getMac() {
        return mac;
    }
 
    public void setMac(String mac) {
        this.mac = mac;
    }
 
    public double getDistance() {
        return distance;
    }
 
    public void setDistance(double distance) {
        this.distance = distance;
    }
 
    @Override
    public int hashCode() {
        return bluetoothAddress.hashCode();
    }
 
    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
 
        if (getClass() != obj.getClass()) {
            return false;
        }
        final BeaconModel model = (BeaconModel) obj;
        
        return Objects.equals(getBluetoothAddress(), model.getBluetoothAddress());
    }
    
    @Override
    public String toString() {
          this.txPower = txPower;
          this.rssi = rssi;
          this.mac = mac;
          this.distance = distance;
        return "name :" + name + "--major:" + major +"--minor:" + minor +"\n" +"proximityUuid :" + proximityUuid + "\n" + "bluetoothAddress:" +bluetoothAddress;
    }
 
}