-
- All Implemented Interfaces:
-
android.os.Parcelable
,java.io.Serializable
public class Region implements Parcelable, Serializable
This class represents a criteria of fields used to match beacons. The uniqueId field is used to distinguish this Region in the system. When you set up monitoring or ranging based on a Region and later want to stop monitoring or ranging, you must do so by passing a Region object that has the same uniqueId field value. If it doesn't match, you can't cancel the operation. There is no other purpose to this field. The region can be constructed from a multi-part identifier. The first identifier is the most significant, the second the second most significant, etc. When constructing a range, any or all of these identifiers may be set to null, which indicates that they are a wildcard and will match any value.
-
-
Field Summary
Fields Modifier and Type Field Description public final static Parcelable.Creator<Region>
CREATOR
-
Constructor Summary
Constructors Constructor Description Region(String uniqueId, Identifier id1, Identifier id2, Identifier id3)
Constructs a new Region object to be used for Ranging or Monitoring Region(String uniqueId, List<Identifier> identifiers)
Constructs a new Region object to be used for Ranging or Monitoring Region(String uniqueId, List<Identifier> identifiers, String bluetoothAddress)
Constructs a new Region object to be used for Ranging or Monitoring Region(String uniqueId, String bluetoothAddress)
Constructs a new Region object to be used for Ranging or Monitoring
-
Method Summary
Modifier and Type Method Description Identifier
getId1()
Convenience method to get the first identifier Identifier
getId2()
Convenience method to get the second identifier Identifier
getId3()
Convenience method to get the third identifier Identifier
getIdentifier(int i)
Returns the 0-indexed identifier Note: IMPORTANT: to get id1, you would call getIdentifier(0); List<Identifier>
getIdentifiers()
String
getUniqueId()
Returns the identifier used to start or stop ranging/monitoring this region when calling the BeaconManager
methods.String
getBluetoothAddress()
Returns the mac address used to filter for beacons boolean
matchesBeacon(Beacon beacon)
Checks to see if an Beacon object is included in the matching criteria of this Region int
hashCode()
boolean
equals(Object other)
boolean
hasSameIdentifiers(Region region)
String
toString()
int
describeContents()
void
writeToParcel(Parcel out, int flags)
Region
clone()
Returns a clone of this instance. -
-
Constructor Detail
-
Region
Region(String uniqueId, Identifier id1, Identifier id2, Identifier id3)
Constructs a new Region object to be used for Ranging or Monitoring- Parameters:
uniqueId
- - A unique identifier used to later cancel Ranging and Monitoring, or change the region being Ranged/Monitoredid1
- - most significant identifier (can be null)id2
- - second most significant identifier (can be null)id3
- - third most significant identifier (can be null)
-
Region
Region(String uniqueId, List<Identifier> identifiers)
Constructs a new Region object to be used for Ranging or Monitoring- Parameters:
uniqueId
- - A unique identifier used to later cancel Ranging and Monitoring, or change the region being Ranged/Monitoredidentifiers
- - list of identifiers for this region
-
Region
Region(String uniqueId, List<Identifier> identifiers, String bluetoothAddress)
Constructs a new Region object to be used for Ranging or Monitoring- Parameters:
uniqueId
- - A unique identifier used to later cancel Ranging and Monitoring, or change the region being Ranged/Monitoredidentifiers
- - list of identifiers for this regionbluetoothAddress
- - mac address
-
Region
Region(String uniqueId, String bluetoothAddress)
Constructs a new Region object to be used for Ranging or Monitoring- Parameters:
uniqueId
- - A unique identifier used to later cancel Ranging and Monitoring, or change the region being Ranged/MonitoredbluetoothAddress
- - mac address used to match beacons
-
-
Method Detail
-
getId1
Identifier getId1()
Convenience method to get the first identifier
-
getId2
Identifier getId2()
Convenience method to get the second identifier
-
getId3
Identifier getId3()
Convenience method to get the third identifier
-
getIdentifier
Identifier getIdentifier(int i)
Returns the 0-indexed identifier Note: IMPORTANT: to get id1, you would call getIdentifier(0);
-
getIdentifiers
List<Identifier> getIdentifiers()
-
getUniqueId
String getUniqueId()
Returns the identifier used to start or stop ranging/monitoring this region when calling the
BeaconManager
methods.
-
getBluetoothAddress
String getBluetoothAddress()
Returns the mac address used to filter for beacons
-
matchesBeacon
boolean matchesBeacon(Beacon beacon)
Checks to see if an Beacon object is included in the matching criteria of this Region
- Parameters:
beacon
- the beacon to check to see if it is in the Region
-
hashCode
int hashCode()
-
hasSameIdentifiers
boolean hasSameIdentifiers(Region region)
-
describeContents
int describeContents()
-
writeToParcel
void writeToParcel(Parcel out, int flags)
-
clone
@Deprecated() Region clone()
Returns a clone of this instance.
-
-
-
-