Class DatabaseConnection


  • public class DatabaseConnection
    extends java.lang.Object
    Wrapper class to wrap around retrieving Firebase data
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.google.firebase.firestore.CollectionReference getCollection​(java.lang.String name)
      Retrieve a firebase collection prefixed by the collection prefix
      java.lang.String getCollectionPrefix()
      All collections have a prefix describing their current environment.
      static DatabaseConnection getInstance()
      Retrieve the instance of the DatabaseConnection
      static void mockInstance​(DatabaseConnection connection)
      Update the instance of the database connection
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DatabaseConnection

        public DatabaseConnection()
    • Method Detail

      • getCollectionPrefix

        public java.lang.String getCollectionPrefix()
        All collections have a prefix describing their current environment.
        Returns:
        collection prefix
      • getCollection

        public com.google.firebase.firestore.CollectionReference getCollection​(java.lang.String name)
        Retrieve a firebase collection prefixed by the collection prefix
        Parameters:
        name - name of the collection
        Returns:
        collection
      • getInstance

        public static DatabaseConnection getInstance()
        Retrieve the instance of the DatabaseConnection
        Returns:
        database connection
      • mockInstance

        public static void mockInstance​(DatabaseConnection connection)
        Update the instance of the database connection
        Parameters:
        connection - database connection