SnapshotListenOptions.Builder

class SnapshotListenOptions.Builder


Builder for constructing SnapshotListenOptions instances.

Summary

Public constructors

Public functions

SnapshotListenOptions

Constructs a SnapshotListenOptions instance using the current settings in this Builder.

SnapshotListenOptions.Builder
setActivity(activity: Activity)

Associates an Activity with this snapshot listener's lifecycle.

SnapshotListenOptions.Builder
setExecutor(executor: Executor)

Sets the executor to be used for snapshot listener callbacks.

SnapshotListenOptions.Builder

Sets whether metadata-only changes should trigger snapshot events.

SnapshotListenOptions.Builder

Sets the preferred source for retrieving data in snapshot listeners.

Public constructors

Builder

Builder()

Public functions

build

fun build(): SnapshotListenOptions

Constructs a SnapshotListenOptions instance using the current settings in this Builder.

Returns
SnapshotListenOptions

The constructed SnapshotListenOptions instance.

setActivity

fun setActivity(activity: Activity): SnapshotListenOptions.Builder

Associates an Activity with this snapshot listener's lifecycle. If set, the listener will automatically stop when the Activity is destroyed.

Parameters
activity: Activity

The Activity to associate with the listener.

Returns
SnapshotListenOptions.Builder

This Builder instance to allow chaining of method calls.

setExecutor

fun setExecutor(executor: Executor): SnapshotListenOptions.Builder

Sets the executor to be used for snapshot listener callbacks.

Parameters
executor: Executor

The executor to be used.

Returns
SnapshotListenOptions.Builder

This Builder instance to allow chaining of method calls.

setMetadataChanges

fun setMetadataChanges(metadataChanges: MetadataChanges): SnapshotListenOptions.Builder

Sets whether metadata-only changes should trigger snapshot events.

Parameters
metadataChanges: MetadataChanges

The setting for metadata-only changes.

Returns
SnapshotListenOptions.Builder

This Builder instance to allow chaining of method calls.

setSource

fun setSource(source: ListenSource): SnapshotListenOptions.Builder

Sets the preferred source for retrieving data in snapshot listeners.

Parameters
source: ListenSource

The preferred source for data retrieval.

Returns
SnapshotListenOptions.Builder

This Builder instance to allow chaining of method calls.