FirebaseFirestoreSettings.Builder

public static final class FirebaseFirestoreSettings.Builder extends Object

A Builder for creating FirebaseFirestoreSettings.

Public Constructor Summary

FirebaseFirestoreSettings.Builder()
Constructs a new FirebaseFirestoreSettings Builder object.
FirebaseFirestoreSettings.Builder(FirebaseFirestoreSettings settings)
Constructs a new FirebaseFirestoreSettings Builder based on an existing FirebaseFirestoreSettings object.

Public Method Summary

FirebaseFirestoreSettings
long
String
boolean
boolean
FirebaseFirestoreSettings.Builder
setCacheSizeBytes(long value)
Sets an approximate cache size threshold for the on-disk data.
FirebaseFirestoreSettings.Builder
setHost(String host)
Sets the host of the Cloud Firestore backend.
FirebaseFirestoreSettings.Builder
setPersistenceEnabled(boolean value)
Enables or disables local persistent storage.
FirebaseFirestoreSettings.Builder
setSslEnabled(boolean value)
Enables or disables SSL for communication.
FirebaseFirestoreSettings.Builder
setTimestampsInSnapshotsEnabled(boolean value)
This method was deprecated. This setting now defaults to true and will be removed in a future release. If you are already setting it to true, just remove the setting. If you are setting it to false, you should update your code to expect Timestamps instead of Dates and then remove the setting.

Inherited Method Summary

Public Constructors

public FirebaseFirestoreSettings.Builder ()

Constructs a new FirebaseFirestoreSettings Builder object.

public FirebaseFirestoreSettings.Builder (FirebaseFirestoreSettings settings)

Constructs a new FirebaseFirestoreSettings Builder based on an existing FirebaseFirestoreSettings object.

Public Methods

public FirebaseFirestoreSettings build ()

public long getCacheSizeBytes ()

Returns
  • cache size for on-disk data.

public String getHost ()

Returns
  • the host of the Cloud Firestore backend.

public boolean isPersistenceEnabled ()

Returns
  • boolean indicating whether local persistent storage is enabled or not.

public boolean isSslEnabled ()

Returns
  • boolean indicating whether SSL is enabled or not.

public FirebaseFirestoreSettings.Builder setCacheSizeBytes (long value)

Sets an approximate cache size threshold for the on-disk data. If the cache grows beyond this size, Cloud Firestore will start removing data that hasn't been recently used. The size is not a guarantee that the cache will stay below that size, only that if the cache exceeds the given size, cleanup will be attempted.

By default, collection is enabled with a cache size of 100 MB. The minimum value is 1 MB.

Returns
  • A settings object on which the cache size is configured as specified by the given value.

public FirebaseFirestoreSettings.Builder setHost (String host)

Sets the host of the Cloud Firestore backend.

Parameters
host The host string
Returns
  • A settings object with the host set.

public FirebaseFirestoreSettings.Builder setPersistenceEnabled (boolean value)