Class QuestionRepository
- java.lang.Object
-
- edu.cnm.deepdive.interviewprep.service.QuestionRepository
-
public class QuestionRepository extends Object
Encapsulates a persistent QuestionRepository object that allows the Question ViewModel to interact with the Web Service Proxy to create, read, insert, and update data to the server.
-
-
Constructor Summary
Constructors Constructor Description QuestionRepository()
Constructor for class that instantiates local fields.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.reactivex.Single<Question>
createQuestion(Question question)
Creates a newQuestion
in the server.io.reactivex.Completable
deleteQuestion(UUID questionId)
Deletes a specifiedQuestion
from the server.io.reactivex.Single<Question>
getQuestion(UUID questionId)
Gets a singleQuestion
from the server.io.reactivex.Single<List<Question>>
getQuestions()
Gets a list of allQuestion
s from the server.io.reactivex.Single<Question>
updateQuestion(Question question)
Updates a singleQuestion
from the server.
-
-
-
Method Detail
-
getQuestions
public io.reactivex.Single<List<Question>> getQuestions()
Gets a list of allQuestion
s from the server.- Returns:
- A list of
Question
objects in the form of a ReactiveXSingle
.
-
getQuestion
public io.reactivex.Single<Question> getQuestion(UUID questionId)
Gets a singleQuestion
from the server.- Parameters:
questionId
- A question id in the form of a universally unique identifier.- Returns:
- A single
Question
object in the form of a ReactiveXSingle
.
-
updateQuestion
public io.reactivex.Single<Question> updateQuestion(Question question)
Updates a singleQuestion
from the server.- Parameters:
question
- A question object.- Returns:
- An updated
Question
object in the form of a ReactiveXSingle
.
-
createQuestion
public io.reactivex.Single<Question> createQuestion(Question question)
Creates a newQuestion
in the server.- Parameters:
question
- A question object.- Returns:
- A newly created
Question
object in the form of a ReactiveXSingle
.
-
-