Class RelationshipRepository
- java.lang.Object
-
- edu.cnm.deepdive.tunefull.service.RelationshipRepository
-
public class RelationshipRepository extends Object
TheRelationshipRepositoryprovides methods that talk to theTunefullWebServiceto receive and save data from and to the server.
-
-
Constructor Summary
Constructors Constructor Description RelationshipRepository(Context context)The constructor gets instances of the singletonsTunefullWebServiceandGoogleSignInService.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Single<List<Relationship>>getFollowing()Returns the current user's following relationships.Single<List<Relationship>>getFriendships()Returns the current user's friendships.Single<List<Relationship>>getPendingRelationships()Returns the current user's pending (i.e.Single<Relationship>saveRelationship(Relationship relationship)Saves a relationship between two users.Single<Relationship>updateRelationship(Relationship relationship, boolean friendAccepted)Updates a selected relationship.
-
-
-
Constructor Detail
-
RelationshipRepository
public RelationshipRepository(Context context)
The constructor gets instances of the singletonsTunefullWebServiceandGoogleSignInService.- 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
Singleof the saved relationship.
-
getFriendships
public Single<List<Relationship>> getFriendships()
Returns the current user's friendships.- Returns:
- A
Singleof the current user's friendships.
-
getFollowing
public Single<List<Relationship>> getFollowing()
Returns the current user's following relationships.- Returns:
- A
Singleof the current user's following relationships.
-
getPendingRelationships
public Single<List<Relationship>> getPendingRelationships()
Returns the current user's pending (i.e. unaccepted) relationships.- Returns:
- A
Singleof 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
Singleof the updated relationship.
-
-