Moved find device to its own utility method, and added a specific equals method and reworked some test.

This commit is contained in:
Ziver Koc 2021-03-23 01:57:12 +01:00
parent 7e8938c38c
commit c7e286f51e
166 changed files with 618 additions and 374 deletions

View file

@ -1,5 +1,6 @@
package se.hal.plugin.netscan;
import se.hal.intf.HalDeviceConfig;
import se.hal.intf.HalEventConfig;
import se.hal.intf.HalEventController;
import se.hal.intf.HalEventData;
@ -23,16 +24,6 @@ public class NetworkDevice implements HalEventConfig {
return host;
}
@Override
public String toString(){
return "Host: "+ host;
}
@Override
public boolean equals(Object obj){
if (obj instanceof NetworkDevice)
return host != null && host.equals(((NetworkDevice) obj).host);
return false;
}
@Override
public Class<? extends HalEventController> getDeviceControllerClass() {
@ -42,4 +33,16 @@ public class NetworkDevice implements HalEventConfig {
public Class<? extends HalEventData> getDeviceDataClass() {
return OnOffEventData.class;
}
@Override
public boolean equals(Object obj){
if (obj instanceof NetworkDevice)
return host != null && host.equals(((NetworkDevice) obj).host);
return false;
}
@Override
public String toString(){
return "Host: "+ host;
}
}