TextClassificationContext.Builder


public final class TextClassificationContext.Builder


A builder for building a TextClassification context.

Summary

Public constructors

Builder(@NonNull String packageName, @NonNull String widgetType)

Initializes a new builder for text classification context objects.

Public methods

@NonNull TextClassificationContext

Builds the text classification context object.

TextClassificationContext.Builder

Sets an optional custom version string for the widget type.

Public constructors

Builder

public Builder(@NonNull String packageName, @NonNull String widgetType)

Initializes a new builder for text classification context objects.

Parameters
@NonNull String packageName

the name of the calling package

@NonNull String widgetType

the type of widget e.g. WIDGET_TYPE_TEXTVIEW

Returns
void

this builder

Public methods

build

public @NonNull TextClassificationContext build()

Builds the text classification context object.

Returns
@NonNull TextClassificationContext

the built TextClassificationContext object

setWidgetVersion

public TextClassificationContext.Builder setWidgetVersion(@Nullable String widgetVersion)

Sets an optional custom version string for the widget type.

Returns
TextClassificationContext.Builder

this builder