public class UserRepository extends Object
Constructor and Description |
---|
UserRepository(Context context)
A constructor for the User Repository class.
|
Modifier and Type | Method and Description |
---|---|
Completable |
delete(User user)
A completable method that deletes the user record from the database
|
Single<User> |
getOrCreate(String oauthKey)
A method that either gets a User or creates one.
|
LiveData<User> |
getUserById(long userId)
A repository method that gets the User by User Id.
|
LiveData<List<User>> |
getUserByUserType(long userTypeId)
Return a LiveData list of type User
|
Completable |
save(User user)
A completable method that either adds the User to the database, and
|
public UserRepository(Context context)
context
- , a context object necessary for the repository.public Completable save(User user)
user
- , a user objectpublic Completable delete(User user)
user
- , a user objectpublic LiveData<List<User>> getUserByUserType(long userTypeId)
userTypeId
- takes a long associated with a UserType.public LiveData<User> getUserById(long userId)
userId
- takes a long parameter in as a userId.