You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Wouldn't it be better just to use MacAddress for equals and hashcode? So you could compare them while observe and just list the current values of a specifiy beacon.
@Overridepublicbooleanequals(Objecto) {
if (this == o) {
returntrue;
}
if (o == null || getClass() != o.getClass()) {
returnfalse;
}
Beaconbeacon = (Beacon) o;
if (rssi != beacon.rssi) {
returnfalse;
}
if (!device.equals(beacon.device)) {
returnfalse;
}
returnArrays.equals(scanRecord, beacon.scanRecord);
}
@OverridepublicinthashCode() {
intresult = device.hashCode();
result = 31 * result + rssi;
result = 31 * result + (scanRecord != null ? Arrays.hashCode(scanRecord) : 0);
returnresult;
}
The text was updated successfully, but these errors were encountered:
We can consider that. MacAddress class was introduced later. It simply wraps and validates data coming from device.getAddress() method. Moreover, device.hashCode() method is used in hashCode() generation for the Beacon class. We should check if introducing MacAdress in the hashCode() and equals() methods won't be redundant to calling device.hashCode() method and using device object.
Wouldn't it be better just to use MacAddress for equals and hashcode? So you could compare them while observe and just list the current values of a specifiy beacon.
The text was updated successfully, but these errors were encountered: