HintFilter


public final class HintFilter
extends Object implements Parcelable

java.lang.Object
   ↳ android.app.personalcontext.hint.HintFilter


Filter for hint refiners and understanders to indicate which hints they want to receive. The filter can be a combination of different criteria, such as the publisher's package or the type of ContextHint. Each parameter can be customized with a number of filter flags. Specifying FILTER_TYPE_ALLOWED limits the returned set to only include the those hints that match the associated filter. Specifying FILTER_TYPE_FILTER_TYPE_REQUIRED means that a hint matching this filter must be present for the set to be returned.

Summary

Nested classes

class HintFilter.Builder

Builder for a HintFilter

Constants

int FILTER_TYPE_ALLOWED

Flag indicating that only hints matching this filter should be included.

int FILTER_TYPE_NONE

Flag indicating no filter is applied

int FILTER_TYPE_REQUIRED

Flag indicating that the returned set must include a hint that matches this filter.

Inherited constants

Fields

public static final Creator<HintFilter> CREATOR

Public methods

int describeContents()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.

Set<Class<T>> getHintTypes()

Returns the ContextHint classes within this filter.

Set<Class<T>> getHintTypes(int filter)

Returns the ContextHint classes within this filter.

Set<String> getPackages()

Returns the publishing packages checked for within this filter.

Set<String> getPackages(int filter)

Returns the publishing packages checked for within this filter.

void writeToParcel(Parcel dest, int flags)

Flatten this object in to a Parcel.

Inherited methods

Constants

FILTER_TYPE_ALLOWED

Added in version 37.2
public static final int FILTER_TYPE_ALLOWED

Flag indicating that only hints matching this filter should be included.

Constant Value: 1 (0x00000001)

FILTER_TYPE_NONE

Added in version 37.2
public static final int FILTER_TYPE_NONE

Flag indicating no filter is applied

Constant Value: 0 (0x00000000)

FILTER_TYPE_REQUIRED

Added in version 37.2
public static final int FILTER_TYPE_REQUIRED

Flag indicating that the returned set must include a hint that matches this filter.

Constant Value: 2 (0x00000002)

Fields

CREATOR

Added in version 37.2
public static final Creator<HintFilter> CREATOR

Public methods

describeContents

Added in version 37.2
public int describeContents ()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of writeToParcel(Parcel,int), the return value of this method must include the CONTENTS_FILE_DESCRIPTOR bit.

Returns
int a bitmask indicating the set of special object types marshaled by this Parcelable object instance.
Value is either 0 or

getHintTypes

Added in version 37.2
public Set<Class<T>> getHintTypes ()

Returns the ContextHint classes within this filter.

Returns
Set<Class<T>> A set of classes in the filter that match the supplied filter type flags.

getHintTypes

Added in version 37.2
public Set<Class<T>> getHintTypes (int filter)

Returns the ContextHint classes within this filter.

Parameters
filter int: the ERROR(FilterType/android.app.personalcontext.hint.HintFilter.FilterType FilterType) flags that should be set on the filters for returned ContextHint classes.
Value is either 0 or a combination of the following:
Returns
Set<Class<T>> A set of classes in the filter that match the supplied filter type flags.

getPackages

Added in version 37.2
public Set<String> getPackages ()

Returns the publishing packages checked for within this filter.

Returns
Set<String> A set of package names in the filter.

getPackages

Added in version 37.2
public Set<String> getPackages (int filter)

Returns the publishing packages checked for within this filter.

Parameters
filter int: the ERROR(FilterType/android.app.personalcontext.hint.HintFilter.FilterType FilterType) flags that should be set on the matching filters.
Value is either 0 or a combination of the following:
Returns
Set<String> A set of package names in the filter that match the supplied filter type flags.

writeToParcel

Added in version 37.2
public void writeToParcel (Parcel dest, 
                int flags)

Flatten this object in to a Parcel.

Parameters
dest Parcel: The Parcel in which the object should be written.
This value cannot be null.

flags int: Additional flags about how the object should be written. May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE.
Value is either 0 or a combination of the following: