SnapshotListenOptions.Builder

public class SnapshotListenOptions.Builder


Builder for constructing SnapshotListenOptions instances.

Summary

Public constructors

Public methods

@NonNull SnapshotListenOptions

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

@NonNull SnapshotListenOptions.Builder

Associates an Activity with this snapshot listener's lifecycle.

@NonNull SnapshotListenOptions.Builder

Sets the executor to be used for snapshot listener callbacks.

@NonNull SnapshotListenOptions.Builder

Sets whether metadata-only changes should trigger snapshot events.

@NonNull SnapshotListenOptions.Builder

Sets the preferred source for retrieving data in snapshot listeners.

Public constructors

Builder

public Builder()

Public methods

build

public @NonNull SnapshotListenOptions build()

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

Returns
@NonNull SnapshotListenOptions

The constructed SnapshotListenOptions instance.

setActivity

public @NonNull SnapshotListenOptions.Builder setActivity(@NonNull Activity activity)

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

Parameters
@NonNull Activity activity

The Activity to associate with the listener.

Returns
@NonNull SnapshotListenOptions.Builder

This Builder instance to allow chaining of method calls.

setExecutor

public @NonNull SnapshotListenOptions.Builder setExecutor(@NonNull Executor executor)

Sets the executor to be used for snapshot listener callbacks.

Parameters
@NonNull Executor executor

The executor to be used.

Returns
@NonNull SnapshotListenOptions.Builder

This Builder instance to allow chaining of method calls.

setMetadataChanges

public @NonNull SnapshotListenOptions.Builder setMetadataChanges(@NonNull MetadataChanges metadataChanges)

Sets whether metadata-only changes should trigger snapshot events.

Parameters
@NonNull MetadataChanges metadataChanges

The setting for metadata-only changes.

Returns
@NonNull SnapshotListenOptions.Builder

This Builder instance to allow chaining of method calls.

setSource

public @NonNull SnapshotListenOptions.Builder setSource(@NonNull ListenSource source)

Sets the preferred source for retrieving data in snapshot listeners.

Parameters
@NonNull ListenSource source

The preferred source for data retrieval.

Returns
@NonNull SnapshotListenOptions.Builder

This Builder instance to allow chaining of method calls.