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

# PlaceFilter

extends Object
implements SafeParcelable

java.lang.Object
↳ | com.google.android.gms.location.places.PlaceFilter

## Class Overview

Specifies constraints to use for filtering the results of some API methods.

## Summary

[Expand] Inherited Constants
From interface com.google.android.gms.common.internal.safeparcel.SafeParcelable
String | NULL |
From interface android.os.Parcelable
int | CONTENTS_FILE_DESCRIPTOR |
int | PARCELABLE_WRITE_RETURN_VALUE |

Public Constructors
| PlaceFilter() Creates a new `PlaceFilter` without any constraints.
| PlaceFilter(boolean requireOpenNow, Collection<String> restrictToPlaceIds) Creates a new `PlaceFilter` with the given constraints.

Public Methods
Set<String> | getPlaceIds() Returns the set of place IDs that this filter will allow.
boolean | isRestrictedToPlacesOpenNow() Checks whether or not this filter will allow only places that are currently open.
boolean | matches(Place place) Checks whether the given `Place` matches the constraints specified in this filter.

[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()
From interface android.os.Parcelable
abstract int | describeContents()
abstract void | writeToParcel(Parcel arg0, int arg1)

## Public Constructors

#### public PlaceFilter ()

Creates a new `PlaceFilter` without any constraints.

A filter without constraints will not filter any results.

#### public PlaceFilter (boolean requireOpenNow, Collection<String> restrictToPlaceIds)

Creates a new `PlaceFilter` with the given constraints.

Places may be filtered by whether or not they are currently open, or by specific place IDs. For more information on place IDs, see the developer's guide.

##### Parameters

requireOpenNow | Whether or not to restrict the results to places which are currently open.
restrictToPlaceIds | The place IDs that this filter should allow. If this is specified, only places corresponding to the given IDs will be returned. If null, no filtering by place IDs will be done.

## Public Methods

#### public Set<String> getPlaceIds ()

Returns the set of place IDs that this filter will allow.

##### Returns

- The set of place IDs allowed by this filter, or an empty set if no filtering by place IDs will be done.

#### public boolean isRestrictedToPlacesOpenNow ()

Checks whether or not this filter will allow only places that are currently open.

##### Returns

- True if only open places are allowed; false if otherwise.

#### public boolean matches (Place place)

Checks whether the given `Place` matches the constraints specified in this filter.

##### Returns

- True if the place is allowed by the filter; false if otherwise.