A builder that builds GeofencingRequest
.Pending
Public Constructor Summary
Builder()
|
Public Method Summary
GeofencingRequest.Builder | |
GeofencingRequest.Builder |
addGeofences(List<Geofence>
geofences)
Adds all the geofences in the given list to be monitored by geofencing service.
|
GeofencingRequest |
build()
Builds the
GeofencingRequest
object.
|
GeofencingRequest.Builder |
setInitialTrigger(int initialTrigger)
Sets the geofence notification behavior at the moment when the geofences are
added.
|
Inherited Method Summary
Public Constructors
public Builder ()
Public Methods
public GeofencingRequest.Builder addGeofence (Geofence geofence)
Adds a geofence to be monitored by geofencing service.
Parameters
geofence | the geofence to be monitored. The geofence must be built with Geofence.Builder . |
---|
Returns
- the builder object itself for method chaining
Throws
IllegalArgumentException | if the geofence is not built with Geofence.Builder . |
---|---|
NullPointerException | if the given geofence is null |
public GeofencingRequest.Builder addGeofences (List<Geofence> geofences)
Adds all the geofences in the given list to be monitored by geofencing service.
Parameters
geofences | the geofences to be monitored. The geofences in the list must be built with
Geofence.Builder . |
---|
Returns
- the builder object itself for method chaining
Throws
IllegalArgumentException | if the geofence is not built with Geofence.Builder . |
---|
public GeofencingRequest build ()
Builds the GeofencingRequest
object.
Returns
- a
GeofencingRequest
object
Throws
IllegalArgumentException | if no geofence has been added to this list |
---|
public GeofencingRequest.Builder setInitialTrigger (int initialTrigger)
Sets the geofence notification behavior at the moment when the geofences are added.
The default behavior is
GeofencingRequest.INITIAL_TRIGGER_ENTER
and
GeofencingRequest.INITIAL_TRIGGER_DWELL
.
Parameters
initialTrigger | the notification behavior. It's a bit-wise of
GeofencingRequest.INITIAL_TRIGGER_ENTER and/or
GeofencingRequest.INITIAL_TRIGGER_EXIT and/or
GeofencingRequest.INITIAL_TRIGGER_DWELL . When
initialTrigger is set to 0 (setInitialTrigger(0) ),
initial trigger would be disabled. |
---|
Returns
- the builder object itself for method chaining