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 newQuestionin the server.io.reactivex.CompletabledeleteQuestion(UUID questionId)Deletes a specifiedQuestionfrom the server.io.reactivex.Single<Question>getQuestion(UUID questionId)Gets a singleQuestionfrom the server.io.reactivex.Single<List<Question>>getQuestions()Gets a list of allQuestions from the server.io.reactivex.Single<Question>updateQuestion(Question question)Updates a singleQuestionfrom the server.
-
-
-
Method Detail
-
getQuestions
public io.reactivex.Single<List<Question>> getQuestions()
Gets a list of allQuestions from the server.- Returns:
- A list of
Questionobjects in the form of a ReactiveXSingle.
-
getQuestion
public io.reactivex.Single<Question> getQuestion(UUID questionId)
Gets a singleQuestionfrom the server.- Parameters:
questionId- A question id in the form of a universally unique identifier.- Returns:
- A single
Questionobject in the form of a ReactiveXSingle.
-
updateQuestion
public io.reactivex.Single<Question> updateQuestion(Question question)
Updates a singleQuestionfrom the server.- Parameters:
question- A question object.- Returns:
- An updated
Questionobject in the form of a ReactiveXSingle.
-
createQuestion
public io.reactivex.Single<Question> createQuestion(Question question)
Creates a newQuestionin the server.- Parameters:
question- A question object.- Returns:
- A newly created
Questionobject in the form of a ReactiveXSingle.
-
-