{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

WriteScope

public interface WriteScope<T extends Object> extends ReadScope


The scope used for a write transaction.

Summary

Public methods

abstract void
writeData(@NonNull T value)

Writes the data to the underlying storage.

Inherited methods

From androidx.datastore.core.Closeable
abstract void

Closes the specified resource.

From androidx.datastore.core.ReadScope
abstract @NonNull T

Read the data from the underlying storage.

Public methods

writeData

abstract void writeData(@NonNull T value)

Writes the data to the underlying storage.