@Entity public class Friendship extends Object implements Serializable
| Constructor and Description |
|---|
Friendship()
Constructs a new instance of
Friendship. |
Friendship(FriendshipState friendshipState,
User user,
User friend) |
| Modifier and Type | Method and Description |
|---|---|
User |
getFriend()
Returns the friend as an
User. |
FriendshipState |
getFriendshipState()
Return the state as an
Friendship |
User |
getUser()
Returns the user as an
User. |
void |
setFriend(User friend)
Changes the friend of the user.
|
void |
setFriendshipState(FriendshipState state)
changes state of friendship
|
void |
setUser(User user)
Changes user in friendship
|
@VisibleForJPA public Friendship()
Friendship. This empty constructor is
required by the JPA framework and should never be used
directly.public Friendship(FriendshipState friendshipState, User user, User friend)
public FriendshipState getFriendshipState()
FriendshipFriendshipStatepublic void setFriendshipState(FriendshipState state) throws NullPointerException
state - The new friendshipState as an FriendshipState. It cannot be nullNullPointerException - if a null state is receivedpublic void setFriend(User friend) throws NullPointerException
friend - The new friend' user as an User. It cannot be
null.NullPointerException - If a null friend is received.public void setUser(User user) throws NullPointerException
user - The new user' friend as an User. It cannot be
null.NullPointerException - If a null user is received.Copyright © 2017. All rights reserved.