X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=micropeak%2FMicroUSB.java;h=092c3d44ef34d8c6bad9bc7f31726053f7072da0;hp=dcc4b602c76101d53b4a083f08fda12fe7c6b33c;hb=56629222711ba3ef7853405c9b07ad614fb29b95;hpb=297eb795b24ec31f6599f48bc8c3769557a7ec6f diff --git a/micropeak/MicroUSB.java b/micropeak/MicroUSB.java index dcc4b602..092c3d44 100644 --- a/micropeak/MicroUSB.java +++ b/micropeak/MicroUSB.java @@ -97,6 +97,25 @@ public class MicroUSB extends altos_device implements AltosDevice { return isFTDI() || isMicro(); } + public int hashCode() { + return getVendor() ^ getProduct() ^ getSerial() ^ getPath().hashCode(); + } + + public boolean equals(Object o) { + if (o == null) + return false; + + if (!(o instanceof MicroUSB)) + return false; + + MicroUSB other = (MicroUSB) o; + + return getVendor() == other.getVendor() && + getProduct() == other.getProduct() && + getSerial() == other.getSerial() && + getPath().equals(other.getPath()); + } + static java.util.List list() { if (!load_library()) return null;