public class BluetoothAddress
extends java.lang.Object
BluetoothAddress
class represents the address of a Bluetooth device.
Addresses may be created by using the class constructor
or retrieved by
listening to connection
events
while scanning
.
A string representation of an address may be retrieved by calling the toString()
method of the
object. The equals(Object)
method may be used in order to check if an address is equal to an other.
Constructor and Description |
---|
BluetoothAddress(java.lang.String string,
boolean isPublic)
Creates an address from the given string.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj)
Returns whether this address is equal to the given object.
|
boolean |
isPublic()
Returns whether this address is a public address.
|
java.lang.String |
toString()
Returns a string representation of this address.
|
public BluetoothAddress(java.lang.String string, boolean isPublic)
string
- a string representing a Bluetooth address.isPublic
- true to create a public address, false to create a private address.java.lang.IllegalArgumentException
- if the given string does not represent a Bluetooth address.public boolean isPublic()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(@Nullable java.lang.Object obj)
equals
in class java.lang.Object