public final class

TextClassification.Request

extends java.lang.Object

 java.lang.Object

↳androidx.textclassifier.TextClassification.Request

Overview

A request object for generating TextClassification.

Summary

Methods
public static TextClassification.RequestcreateFromBundle(Bundle bundle)

Extracts a Request from a bundle that was added using TextClassification.Request.toBundle().

public LocaleListCompatgetDefaultLocales()

public intgetEndIndex()

Returns end index of the text to classify.

public BundlegetExtras()

Returns the extended, vendor specific data.

public java.lang.LonggetReferenceTime()

public intgetStartIndex()

Returns start index of the text to classify.

public java.lang.CharSequencegetText()

Returns the text providing context for the text to classify (which is specified by the sub sequence starting at startIndex and ending at endIndex)

public BundletoBundle()

Adds this Request to a Bundle that can be read back with the same parameters to TextClassification.Request.createFromBundle(Bundle).

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Methods

public java.lang.CharSequence getText()

Returns the text providing context for the text to classify (which is specified by the sub sequence starting at startIndex and ending at endIndex)

public int getStartIndex()

Returns start index of the text to classify.

public int getEndIndex()

Returns end index of the text to classify.

public LocaleListCompat getDefaultLocales()

Returns:

ordered list of locale preferences that can be used to disambiguate the provided text.

public java.lang.Long getReferenceTime()

Returns:

reference time based on which relative dates (e.g. "tomorrow") should be interpreted. This should be milliseconds from the epoch of 1970-01-01T00:00:00Z(UTC timezone).

public Bundle getExtras()

Returns the extended, vendor specific data.

NOTE: Each call to this method returns a new bundle copy so clients should prefer to hold a reference to the returned bundle rather than frequently calling this method. Avoid updating the content of this bundle. On pre-O devices, the values in the Bundle are not deep copied.

public Bundle toBundle()

Adds this Request to a Bundle that can be read back with the same parameters to TextClassification.Request.createFromBundle(Bundle).

public static TextClassification.Request createFromBundle(Bundle bundle)

Extracts a Request from a bundle that was added using TextClassification.Request.toBundle().