我正在开发一个使用该ScanResult
对象的 Android 应用程序。该对象的形式为:
[SSID: __mynetwork__, BSSID: 00:0e:2e:ae:4e:85, capabilities: [WPA-PSK-TKIP][ESS], level: -69, frequency: 2457, timestamp: 117455824743]
我将如何仅覆盖该方法而不创建扩展它的客户类equals()
以便仅比较SSID
、BSSID
、capabilties
和属性?换句话说,我想在方法中消除属性,这样当我比较这两个对象时,方法会返回一个值:level
frequency
equals
timestamp
equals()
true
[SSID: __mynetwork__, BSSID: 00:0e:2e:ae:4e:85, capabilities: [WPA-PSK-TKIP][ESS], level: -69, frequency: 2457, timestamp: 117455824743]
[SSID: __mynetwork__, BSSID: 00:0e:2e:ae:4e:85, capabilities: [WPA-PSK-TKIP][ESS], level: -69, frequency: 2457, timestamp: 117460312231]
注意:当我派生一个扩展的客户类时,ScanResult
当我尝试实现构造函数时出现以下错误:The constructor ScanResult() is not visible