public final class CBRegion
extends java.lang.Object
The identifier 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 identifier 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.
Constructor and Description |
---|
CBRegion(java.lang.String identifier)
Constructs a new CBRegion object to be used for Ranging or Monitoring.
|
CBRegion(java.lang.String identifier,
java.util.UUID proximityUUID)
Constructs a new CBRegion object to be used for Ranging or Monitoring.
|
CBRegion(java.lang.String identifier,
java.util.UUID proximityUUID,
java.lang.Integer major)
Constructs a new CBRegion object to be used for Ranging or Monitoring.
|
CBRegion(java.lang.String identifier,
java.util.UUID proximityUUID,
java.lang.Integer major,
java.lang.Integer minor)
Constructs a new CBRegion object to be used for Ranging or Monitoring.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object other) |
java.lang.String |
getIdentifier()
Returns the identifier used to start or stop ranging/monitoring this region.
|
java.lang.Integer |
getMajor()
Returns the second most significant identifier (major)
|
java.lang.Integer |
getMinor()
Returns the third most significant identifier (minor)
|
java.util.UUID |
getProximityUUID()
Returns the most significant identifier (proximity UUID)
|
int |
hashCode() |
boolean |
matchesBeacon(CBBeacon beacon)
Checks to see if an CBBeacon object is included in the matching criteria of this CBRegion
|
java.lang.String |
toString() |
public CBRegion(@NonNull java.lang.String identifier)
identifier
- A unique identifier used to cancel Ranging and Monitoring later,
or change the region being Ranged/MonitoredCBRegion(String, UUID)
,
CBRegion(String, UUID, Integer)
,
CBRegion(String, UUID, Integer, Integer)
public CBRegion(@NonNull java.lang.String identifier, @Nullable java.util.UUID proximityUUID)
identifier
- A unique identifier used to cancel Ranging and Monitoring later,
or change the region being Ranged/MonitoredproximityUUID
- The most significant identifier (can be null)CBRegion(String)
,
CBRegion(String, UUID, Integer)
,
CBRegion(String, UUID, Integer, Integer)
public CBRegion(@NonNull java.lang.String identifier, @Nullable java.util.UUID proximityUUID, @Nullable java.lang.Integer major)
identifier
- A unique identifier used to cancel Ranging and Monitoring later,
or change the region being Ranged/MonitoredproximityUUID
- The most significant identifier (can be null)major
- The second most significant identifier (can be null)CBRegion(String)
,
CBRegion(String, UUID)
,
CBRegion(String, UUID, Integer, Integer)
public CBRegion(@NonNull java.lang.String identifier, @Nullable java.util.UUID proximityUUID, @Nullable java.lang.Integer major, @Nullable java.lang.Integer minor)
identifier
- A unique identifier used to cancel Ranging and Monitoring later,
or change the region being Ranged/MonitoredproximityUUID
- The most significant identifier (can be null)major
- The second most significant identifier (can be null)minor
- The third most significant identifier (can be null)CBRegion(String)
,
CBRegion(String, UUID)
,
CBRegion(String, UUID, Integer)
public java.lang.String getIdentifier()
public java.util.UUID getProximityUUID()
public java.lang.Integer getMajor()
public java.lang.Integer getMinor()
public boolean matchesBeacon(CBBeacon beacon)
beacon
- the beacon to check to see if it is in the Regionpublic int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object