Summary: Ctors | Methods | Inherited Methods | [Expand All]
public static class

# FenceUpdateRequest.Builder

extends Object

java.lang.Object
↳ | com.google.android.gms.awareness.fence.FenceUpdateRequest.Builder

## Class Overview

Builder for a `FenceUpdateRequest`.

## Summary

Public Constructors
| FenceUpdateRequest.Builder() Builder for a `FenceUpdateRequest`.

Public Methods
FenceUpdateRequest.Builder | addFence(String key, AwarenessFence fence, PendingIntent pendingIntent) Adds a `fence` identified by the given `key` to get callbacks to the `pendingIntent` when triggered.
FenceUpdateRequest | build() Builds the fence update request.
FenceUpdateRequest.Builder | removeFence(String key) Removes the fence with the given `key`.
FenceUpdateRequest.Builder | removeFence(PendingIntent pendingIntent) Removes all fences associated with the `pendingIntent`.

[Expand] Inherited Methods
From class java.lang.Object
Object | clone()
boolean | equals(Object arg0)
void | finalize()
final Class<?> | getClass()
int | hashCode()
final void | notify()
final void | notifyAll()
String | toString()
final void | wait(long arg0, int arg1)
final void | wait(long arg0)
final void | wait()

## Public Constructors

#### public FenceUpdateRequest.Builder ()

Builder for a `FenceUpdateRequest`.

## Public Methods

#### public FenceUpdateRequest.Builder addFence (String key, AwarenessFence fence, PendingIntent pendingIntent)

Adds a `fence` identified by the given `key` to get callbacks to the `pendingIntent` when triggered. To get data from the returned Intent, use the `extract(Intent)` utility method. If a fence with the given `key` already exists, then this new fence will replace the existing one, and any callbacks to a previous pending intent will cease.

##### Parameters

key | The unique identifier for this fence, which can be used to either remove or replace the existing fence.
fence | The fence that is to be registered.
pendingIntent | The `PendingIntent` that receives callbacks whenever the `fence`'s state changes. Use the `extract(Intent)` method to get details about the fence that was triggered.

##### Returns

- This `FenceUpdateRequest.Builder` object.

#### public FenceUpdateRequest build ()

Builds the fence update request.

##### Returns

- The `FenceUpdateRequest` object.

#### public FenceUpdateRequest.Builder removeFence (String key)

Removes the fence with the given `key`.

##### Parameters

key | the key that was passed into `addFence(String, AwarenessFence, PendingIntent)` that identifies the fence to remove.

##### Returns

- This `FenceUpdateRequest.Builder` object.

#### public FenceUpdateRequest.Builder removeFence (PendingIntent pendingIntent)

Removes all fences associated with the `pendingIntent`.

##### Parameters

pendingIntent | The `PendingIntent` that was passed into `addFence(String, AwarenessFence, PendingIntent)`.

##### Returns

- This `FenceUpdateRequest.Builder` object.