Class Relationship
- java.lang.Object
-
- edu.cnm.deepdive.tunefull.model.entity.Relationship
-
@Entity public class Relationship extends java.lang.Object
The
Relationship
entity holds the data for each user-to-user relationship in the TuneFull server and provides a method to facilitate getting the other user in the relationship.- Since:
- 1.0
- Version:
- 1.0
- Author:
- Robert Dominguez, Roderick Frechette, Laura Steiner
-
-
Constructor Summary
Constructors Constructor Description Relationship()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Boolean
getFriendAccepted()
Returns the Boolean indicating whether a friend relationship has been accepted, denied, or not yet responded to.java.lang.Long
getId()
Returns the id for the relationship.User
getRequested()
Returns theUser
entity associated with the user who received the relationship request.User
getRequester()
Returns theUser
entity associated with the user who requested the relationship.boolean
isFriendRelationship()
Returns a boolean indicating whether the relationship is a friendship or simply a follow relationship.User
other(User self)
Returns the user on the other side of the relationship from the current user: the requested if the current user is the requester, and the requester if the current user is the requested.void
setFriendAccepted(java.lang.Boolean friendAccepted)
Sets the Boolean indicating whether a friend relationship has been accepted, denied, or not yet responded to.void
setFriendRelationship(boolean friendRelationship)
Sets the boolean indicating whether the relationship is a friendship or simply a follow relationship.void
setRequested(User requested)
Sets theUser
entity associated with the user who received the relationship request.void
setRequester(User requester)
Sets theUser
entity associated with the user who requested the relationship.
-
-
-
Method Detail
-
getId
public java.lang.Long getId()
Returns the id for the relationship.- Returns:
-
getRequester
@NonNull public User getRequester()
Returns theUser
entity associated with the user who requested the relationship.- Returns:
-
setRequester
public void setRequester(@NonNull User requester)
Sets theUser
entity associated with the user who requested the relationship.- Parameters:
requester
-User
-
getRequested
@NonNull public User getRequested()
Returns theUser
entity associated with the user who received the relationship request.- Returns:
-
setRequested
public void setRequested(@NonNull User requested)
Sets theUser
entity associated with the user who received the relationship request.- Parameters:
requested
-User
-
isFriendRelationship
public boolean isFriendRelationship()
Returns a boolean indicating whether the relationship is a friendship or simply a follow relationship.- Returns:
-
setFriendRelationship
public void setFriendRelationship(boolean friendRelationship)
Sets the boolean indicating whether the relationship is a friendship or simply a follow relationship.- Parameters:
friendRelationship
- boolean
-
getFriendAccepted
public java.lang.Boolean getFriendAccepted()
Returns the Boolean indicating whether a friend relationship has been accepted, denied, or not yet responded to.- Returns:
-
setFriendAccepted
public void setFriendAccepted(java.lang.Boolean friendAccepted)
Sets the Boolean indicating whether a friend relationship has been accepted, denied, or not yet responded to.- Parameters:
friendAccepted
- Boolean
-
other
public User other(User self)
Returns the user on the other side of the relationship from the current user: the requested if the current user is the requester, and the requester if the current user is the requested.- Parameters:
self
-User
- Returns:
- the user in the relationship that is not the current user
-
-