diff options
author | Sven Gothel <[email protected]> | 2022-02-08 13:03:09 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2022-02-08 13:03:09 +0100 |
commit | d200174a7c14961cd3ab2d8ee936458f2aae5234 (patch) | |
tree | ccb066bcc64805adfe7842b6eaa05fe2c6c99a69 | |
parent | 3608b45464094ea465a490a0095863eae2aa4328 (diff) |
BT[Adapter|Device].java: Document equals(..) method
-rw-r--r-- | java/jau/direct_bt/DBTDevice.java | 26 | ||||
-rw-r--r-- | java/org/direct_bt/BTAdapter.java | 9 | ||||
-rw-r--r-- | java/org/direct_bt/BTDevice.java | 9 |
3 files changed, 31 insertions, 13 deletions
diff --git a/java/jau/direct_bt/DBTDevice.java b/java/jau/direct_bt/DBTDevice.java index 4d1a9d8a..56c8c432 100644 --- a/java/jau/direct_bt/DBTDevice.java +++ b/java/jau/direct_bt/DBTDevice.java @@ -114,19 +114,6 @@ public class DBTDevice extends DBTObject implements BTDevice } @Override - public boolean equals(final Object obj) - { - if(this == obj) { - return true; - } - if (obj == null || !(obj instanceof DBTDevice)) { - return false; - } - final DBTDevice other = (DBTDevice)obj; - return addressAndType.equals(other.addressAndType); - } - - @Override public final long getCreationTimestamp() { return ts_creation; } @Override @@ -145,6 +132,19 @@ public class DBTDevice extends DBTObject implements BTDevice private native byte getRoleImpl(); @Override + public boolean equals(final Object obj) + { + if(this == obj) { + return true; + } + if (obj == null || !(obj instanceof DBTDevice)) { + return false; + } + final DBTDevice other = (DBTDevice)obj; + return addressAndType.equals(other.addressAndType); + } + + @Override public BDAddressAndType getAddressAndType() { return addressAndType; } @Override diff --git a/java/org/direct_bt/BTAdapter.java b/java/org/direct_bt/BTAdapter.java index 8647a865..f12a7649 100644 --- a/java/org/direct_bt/BTAdapter.java +++ b/java/org/direct_bt/BTAdapter.java @@ -434,6 +434,15 @@ public interface BTAdapter extends BTObject boolean isAdvertising(); /** + * If both types are of {@link BTAdapter}, it compares their {@link BDAddressAndType}, see {@link #getAddressAndType()}. + * <p> + * {@inheritDoc} + * </p> + */ + @Override + boolean equals(final Object obj); + + /** * Returns the adapter's public BDAddressAndType. * <p> * The adapter's address as initially reported by the system is always its public address, i.e. {@link BDAddressType#BDADDR_LE_PUBLIC}. diff --git a/java/org/direct_bt/BTDevice.java b/java/org/direct_bt/BTDevice.java index 6b25a3cf..704c75b0 100644 --- a/java/org/direct_bt/BTDevice.java +++ b/java/org/direct_bt/BTDevice.java @@ -768,6 +768,15 @@ public interface BTDevice extends BTObject long getLastUpdateTimestamp(); /** + * If both types are of {@link BTDevice}, it compares their {@link BDAddressAndType}, see {@link #getAddressAndType()}. + * <p> + * {@inheritDoc} + * </p> + */ + @Override + boolean equals(final Object obj); + + /** * Returns the unique device {@link EUI48} address and {@link BDAddressType} type. * @since 2.2.0 */ |