ihorvitruk / buddysearch

Android Clean Architecture example using MVP, Rx: RxJava, RxAndroid, Dagger 2, Data Binding, Retrolambda, Firebase Database, Firebase Auth, Firebase Messaging (FCM), Realm
Apache License 2.0
208 stars 44 forks source link

UserDto setId() missing #2

Closed Mfrenchy77 closed 7 years ago

Mfrenchy77 commented 7 years ago

In Data module manager/impl AuthMangagerImpl you have saveUser(FirebaseUser user, Subscsriber subscriber)

There you create a new UserDto and call setId.

The only set Id i found was from Entity, am I doing something wrong, the code won't compile for me?

Should there be getters and setters for the Dto?

ihorvitruk commented 7 years ago

Hello, @Mfrenchy77 ! Thanks for your question. I use Lombok library, and its annotation @Data for POJO-classes, like UserDto. This annotation defines getters/setters, toString and other useful methods (See details on their site). Android Studio IDE does not compile your code, because you need to install Lombok Plugin. For this, go to Preferences -> Plugins -> Browse Repositories and search for "Lombok plugin". After you successfully install this plugin and restart Android Studio , everything should work fine, compilation errors related to "getters/setters" should not occur.

Mfrenchy77 commented 7 years ago

Thanks, got it working!

Btw, really appreciate you doing this. I'm creating an app with firebase and realm too and wanted to learn Rx and dagger. I'm still new to MVP as well so your project is great for me.

Would love to see documentation in the code, but am happy either way.