daily pastebin goal
4%
SHARE
TWEET

Untitled

a guest Oct 1st, 2018 102 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class UserViewModel extends AndroidViewModel {
  2.  
  3.     private UserRepository mRepository;
  4.  
  5.     private LiveData<List<User>> mAllWordsLive;
  6.  
  7.     public UserViewModel(Application application) {
  8.         super(application);
  9.         mRepository = new UserRepository(application);
  10.         mAllWordsLive = mRepository.getAllUsersLive();
  11.     }
  12.  
  13.     public LiveData<List<User>> getAllUsersLive() {
  14.         return mAllWordsLive;
  15.     }
  16.  
  17.     public LiveData<User> getUserItemById(ParcelUuid parcelUuid) {
  18.         return mRepository.getUserItemById(parcelUuid);
  19.     }
  20.  
  21.     public void insert(User word) {
  22.         mRepository.insert(word);
  23.     }
  24.  
  25.     public void delete(User word) {
  26.         mRepository.delete(word);
  27.     }
  28.  
  29.     public void update(User word) {
  30.         mRepository.update(word);
  31.     }
  32. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top