SpellCheckerSession.SpellCheckerSessionParams.Builder


public static final class SpellCheckerSession.SpellCheckerSessionParams.Builder
extends Object

java.lang.Object
   ↳ android.view.textservice.SpellCheckerSession.SpellCheckerSessionParams.Builder


Builder of SpellCheckerSessionParams.

Summary

Public constructors

Builder()

Constructs a Builder.

Public methods

SpellCheckerSession.SpellCheckerSessionParams build()

Returns constructed SpellCheckerSession instance.

SpellCheckerSession.SpellCheckerSessionParams.Builder setExtras(Bundle extras)

Sets a bundle containing extra parameters for the spell checker.

SpellCheckerSession.SpellCheckerSessionParams.Builder setLocale(Locale locale)

Sets the locale in which the spell checker should operate.

SpellCheckerSession.SpellCheckerSessionParams.Builder setShouldReferToSpellCheckerLanguageSettings(boolean shouldReferToSpellCheckerLanguageSettings)

Sets whether or not the user's spell checker language settings should be used to determine spell checker locale.

SpellCheckerSession.SpellCheckerSessionParams.Builder setSupportedAttributes(int supportedAttributes)

Sets a bitmask of SuggestionsInfo attributes that the spell checker can set in SuggestionsInfo it returns.

Inherited methods

Object clone()

Creates and returns a copy of this object.

boolean equals(Object obj)

Indicates whether some other object is "equal to" this one.

void finalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

final Class<?> getClass()

Returns the runtime class of this Object.

int hashCode()

Returns a hash code value for the object.

final void notify()

Wakes up a single thread that is waiting on this object's monitor.

final void notifyAll()

Wakes up all threads that are waiting on this object's monitor.

String toString()

Returns a string representation of the object.

final void wait(long timeoutMillis, int nanos)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait(long timeoutMillis)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait()

Causes the current thread to wait until it is awakened, typically by being notified or interrupted.

Public constructors

Builder

Added in API level 31
public Builder ()

Constructs a Builder.

Public methods

build

Added in API level 31
public SpellCheckerSession.SpellCheckerSessionParams build ()

Returns constructed SpellCheckerSession instance.

Before calling this method, either setLocale(java.util.Locale) should be called with a non-null locale or setShouldReferToSpellCheckerLanguageSettings(boolean) should be called with true.

setExtras

Added in API level 31
public SpellCheckerSession.SpellCheckerSessionParams.Builder setExtras (Bundle extras)

Sets a bundle containing extra parameters for the spell checker.

This bundle can be used to pass implementation-specific parameters to the SpellCheckerService implementation.

Parameters
extras Bundle: This value cannot be null.

Returns
SpellCheckerSession.SpellCheckerSessionParams.Builder This value cannot be null.

setLocale

Added in API level 31
public SpellCheckerSession.SpellCheckerSessionParams.Builder setLocale (Locale locale)

Sets the locale in which the spell checker should operate.

Parameters
locale Locale: This value may be null.

Returns
SpellCheckerSession.SpellCheckerSessionParams.Builder This value cannot be null.

setShouldReferToSpellCheckerLanguageSettings

Added in API level 31
public SpellCheckerSession.SpellCheckerSessionParams.Builder setShouldReferToSpellCheckerLanguageSettings (boolean shouldReferToSpellCheckerLanguageSettings)

Sets whether or not the user's spell checker language settings should be used to determine spell checker locale.

If shouldReferToSpellCheckerLanguageSettings is true, the exact way of determining spell checker locale differs based on locale specified in setLocale(java.util.Locale). If shouldReferToSpellCheckerLanguageSettings is true and locale is null, the locale specified in Settings will be used. If shouldReferToSpellCheckerLanguageSettings is true and locale is not null, SpellCheckerSession can be created only when the locale specified in Settings is the same as locale. Exceptionally, if shouldReferToSpellCheckerLanguageSettings is true and locale is language only (e.g. "en"), the specified locale in Settings (e.g. "en_US") will be used.

Parameters
shouldReferToSpellCheckerLanguageSettings boolean

See also:

setSupportedAttributes

Added in API level 31
public SpellCheckerSession.SpellCheckerSessionParams.Builder setSupportedAttributes (int supportedAttributes)

Sets a bitmask of SuggestionsInfo attributes that the spell checker can set in SuggestionsInfo it returns.

Returns
SpellCheckerSession.SpellCheckerSessionParams.Builder This value cannot be null.