FirebaseModelManager

public class FirebaseModelManager extends Object

Manages the registration of remote and local models.

Before using a model, register it with FirebaseModelManager. The model name is the key for a model, and a model name can only be registered once.

For the remote model's name, use the same name as the model that's been uploaded to the Firebase console.

This class is thread safe.

Public Method Summary

synchronized static FirebaseModelManager
getInstance()
Gets an instance of a FirebaseModelManager corresponding to the default FirebaseApp instance.
synchronized boolean
registerLocalModel(FirebaseLocalModel localModel)
Registers a local model.
synchronized boolean
registerRemoteModel(FirebaseRemoteModel remoteModel)
Registers a remote model.

Inherited Method Summary

Public Methods

public static synchronized FirebaseModelManager getInstance ()

Gets an instance of a FirebaseModelManager corresponding to the default FirebaseApp instance.

public synchronized boolean registerLocalModel (FirebaseLocalModel localModel)

Registers a local model. Local models are keyed by model names, and each model name can be registered at most once.

Returns
  • false if the model name is already registered. True if registration succeeds.
Throws
NullPointerException if localModel is null.

public synchronized boolean registerRemoteModel (FirebaseRemoteModel remoteModel)

Registers a remote model. Remote models are the models that are downloaded and used on devices. The remote models are keyed by model names, and each model name can be registered at most once.

For the remote model's name, use the same name as the model that's been uploaded to the Firebase console.

Returns
  • false if the model name is already registered. True if registration succeeds.
Throws
NullPointerException if remoteModel is null.