Skip to content

Commit 776fbd3

Browse files
committed
Add getter for casted access to database instance in 'Meteor'
1 parent 848375d commit 776fbd3

File tree

1 file changed

+16
-1
lines changed
  • Source/library/src/main/java/im/delight/android/ddp

1 file changed

+16
-1
lines changed

Source/library/src/main/java/im/delight/android/ddp/Meteor.java

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
*/
1818

1919
import im.delight.android.ddp.db.DataStore;
20+
import im.delight.android.ddp.db.Database;
2021
import java.net.URI;
2122
import android.content.SharedPreferences;
2223
import android.content.Context;
@@ -1209,10 +1210,24 @@ private void announceSessionReady(final boolean signedInAutomatically) {
12091210
/**
12101211
* Returns the data store that was set in the constructor and that contains all data received from the server
12111212
*
1212-
* @return the data store
1213+
* @return the data store or `null`
12131214
*/
12141215
public DataStore getDataStore() {
12151216
return mDataStore;
12161217
}
12171218

1219+
/**
1220+
* Returns the database that was set in the constructor and that contains all data received from the server
1221+
*
1222+
* @return the database or `null`
1223+
*/
1224+
public Database getDatabase() {
1225+
if (mDataStore instanceof Database) {
1226+
return (Database) mDataStore;
1227+
}
1228+
else {
1229+
return null;
1230+
}
1231+
}
1232+
12181233
}

0 commit comments

Comments
 (0)