Created
February 1, 2022 04:14
-
-
Save bijukunjummen/66705bc3460983fa737ed9711af95e0e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public ChatRoom getById(String id) { | |
| ApiFuture<DocumentSnapshot> chatRoomSnapshotFuture = | |
| firestore.collection(ServiceConstants.CHAT_ROOMS).document(id).get(); | |
| try { | |
| DocumentSnapshot chatRoomSnapshot = chatRoomSnapshotFuture.get(); | |
| return new ChatRoom(chatRoomSnapshot.getId(), chatRoomSnapshot.getString("name")); | |
| } catch (Exception e) { | |
| throw new RuntimeException("Could not retrieve by id", e); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment