public class ProximityBeacon
extends java.lang.Object
implements java.io.Serializable
Container for a Meridian proximity beacon and its related fields. This is used for triggers.
Constructor and Description |
---|
ProximityBeacon()
An empty ProximityBeacon constructor.
|
ProximityBeacon(int major,
int minor)
Initialize a MR beacon by its major/minor
|
ProximityBeacon(java.lang.String address)
Initialize a MR beacon by its MAC address
|
Modifier and Type | Method and Description |
---|---|
static java.util.List<ProximityBeacon> |
fromJSONArray(org.json.JSONArray json,
java.lang.String locationId)
Static initializer for creating a list of ProximityBeacons from its json representation.
|
static ProximityBeacon |
fromJSONObject(org.json.JSONObject json,
java.lang.String locationId)
Static initializer for creating a ProximityBeacon from its json representation.
|
java.lang.String |
getAddress()
The unique Bluetooth MAC address of this beacon.
|
int |
getMajor()
The Beacon’s major identifier.
|
EditorKey |
getMapKey()
The Beacon’s map key.
|
int |
getMinor()
The Beacon’s minor identifier.
|
java.lang.String |
getName()
The human readable name of this Beacon (e.g.
|
java.lang.String |
getUUID()
Gets the UUID for this beacon.
|
float |
getX()
This beacon’s x coordinate on its parent Meridian Map.
|
float |
getY()
This beacon’s y coordinate on its parent Meridian Map.
|
boolean |
isInvalid()
Returns true if the ProximityBeacon does not represent a point on a map.
|
java.lang.String |
majorMinorString()
Gets the major/minor string of this Beacon.
|
void |
setMajor(int major)
Set the Beacon’s major identifier.
|
void |
setMinor(int minor)
Set the Beacon’s minor identifier.
|
void |
setName(java.lang.String name)
Sets the human readable name of this Beacon (e.g.
|
java.lang.String |
toString() |
public ProximityBeacon()
An empty ProximityBeacon constructor.
public ProximityBeacon(int major, int minor)
Initialize a MR beacon by its major/minor
major
- minor
- public ProximityBeacon(java.lang.String address)
Initialize a MR beacon by its MAC address
address
- public java.lang.String getUUID()
Gets the UUID for this beacon.
public java.lang.String getAddress()
The unique Bluetooth MAC address of this beacon.
public java.lang.String getName()
The human readable name of this Beacon (e.g. ‘Joe’s Office’, ‘Fountain’)
public void setName(java.lang.String name)
Sets the human readable name of this Beacon (e.g. ‘Joe’s Office’, ‘Fountain’)
public float getX()
This beacon’s x coordinate on its parent Meridian Map.
public float getY()
This beacon’s y coordinate on its parent Meridian Map.
public int getMajor()
The Beacon’s major identifier.
public void setMajor(int major)
Set the Beacon’s major identifier.
public int getMinor()
The Beacon’s minor identifier.
public void setMinor(int minor)
Set the Beacon’s minor identifier.
public EditorKey getMapKey()
The Beacon’s map key.
public static ProximityBeacon fromJSONObject(org.json.JSONObject json, java.lang.String locationId) throws org.json.JSONException
Static initializer for creating a ProximityBeacon from its json representation.
json
- A known json representation of the ProximityBeacon to be initialized.locationId
- A known Meridian location id for the initialized ProximityBeacon.org.json.JSONException
- on JSON parsing errorpublic static java.util.List<ProximityBeacon> fromJSONArray(org.json.JSONArray json, java.lang.String locationId) throws org.json.JSONException
Static initializer for creating a list of ProximityBeacons from its json representation.
json
- A json representation of the ProximityBeacon list.locationId
- A known Meridian location id for the ProximityBeacon in the list.org.json.JSONException
- on JSON parsing errorpublic java.lang.String majorMinorString()
Gets the major/minor string of this Beacon.
public boolean isInvalid()
Returns true if the ProximityBeacon does not represent a point on a map.
@NonNull public java.lang.String toString()
toString
in class java.lang.Object