Class RelationshipRepository


  • public class RelationshipRepository
    extends Object
    The RelationshipRepository provides methods that talk to the TunefullWebService to receive and save data from and to the server.
    • Constructor Detail

      • RelationshipRepository

        public RelationshipRepository​(Context context)
        The constructor gets instances of the singletons TunefullWebService and GoogleSignInService.
        Parameters:
        context - The current context.
    • Method Detail

      • saveRelationship

        public Single<Relationship> saveRelationship​(Relationship relationship)
        Saves a relationship between two users.
        Parameters:
        relationship - The relationship to be saved.
        Returns:
        A Single of the saved relationship.
      • getFriendships

        public Single<List<Relationship>> getFriendships()
        Returns the current user's friendships.
        Returns:
        A Single of the current user's friendships.
      • getFollowing

        public Single<List<Relationship>> getFollowing()
        Returns the current user's following relationships.
        Returns:
        A Single of the current user's following relationships.
      • getPendingRelationships

        public Single<List<Relationship>> getPendingRelationships()
        Returns the current user's pending (i.e. unaccepted) relationships.
        Returns:
        A Single of the current user's profile.
      • updateRelationship

        public Single<Relationship> updateRelationship​(Relationship relationship,
                                                       boolean friendAccepted)
        Updates a selected relationship.
        Parameters:
        relationship - The relationship to be updated.
        friendAccepted - Whether the friend request has been accepted or not.
        Returns:
        A Single of the updated relationship.