Class 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 Detail

      • QuestionRepository

        public QuestionRepository()
        Constructor for class that instantiates local fields.
    • Method Detail

      • getQuestions

        public io.reactivex.Single<List<Question>> getQuestions()
        Gets a list of all Questions from the server.
        Returns:
        A list of Question objects in the form of a ReactiveX Single.
      • getQuestion

        public io.reactivex.Single<Question> getQuestion​(UUID questionId)
        Gets a single Question 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 ReactiveX Single.
      • updateQuestion

        public io.reactivex.Single<Question> updateQuestion​(Question question)
        Updates a single Question from the server.
        Parameters:
        question - A question object.
        Returns:
        An updated Question object in the form of a ReactiveX Single.
      • createQuestion

        public io.reactivex.Single<Question> createQuestion​(Question question)
        Creates a new Question in the server.
        Parameters:
        question - A question object.
        Returns:
        A newly created Question object in the form of a ReactiveX Single.
      • deleteQuestion

        public io.reactivex.Completable deleteQuestion​(UUID questionId)
        Deletes a specified Question from the server.
        Parameters:
        questionId - A question id in the form of a universally unique identifier.
        Returns:
        A ReactiveX Completable.