Class User
- java.lang.Object
-
- edu.cnm.deepdive.tunefull.model.entity.User
-
- All Implemented Interfaces:
java.lang.Comparable<User>
@Entity public class User extends java.lang.Object implements java.lang.Comparable<User>
The
Userentity holds the data for each user in the TuneFull server and provides methods to access lists of data.As well as fields of data, and methods to access that data, the
Userentity contains the nested enumUser.Genre, which enumerates a basic list of favorite musical genres for the user to select from.- Since:
- 1.0
- Version:
- 1.0
- Author:
- Robert Dominguez, Roderick Frechette, Laura Steiner
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classUser.GenreTheGenreenum enumerates different musical genres that the user can select from for their favorite genre.
-
Constructor Summary
Constructors Constructor Description User()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(User other)java.util.List<Clip>getClips()Returns the list of clips posted by the user.java.lang.StringgetEmail()Returns the user's email address.User.GenregetGenre()Returns the user's favorite genre as an enumerated type from theUser.Genreenum.java.lang.LonggetId()Returns the id for the user.java.lang.StringgetOauth()Returns the user's OAuth 2.0 key.java.util.List<Relationship>getRelationshipsInitiated()Returns the list of relationships that the user has initiated.java.util.List<Relationship>getRelationshipsReceived()Returns the list of relationships that the user has received requests for.java.lang.StringgetUsername()Returns the user's username.voidsetEmail(java.lang.String email)Sets the user's email address.voidsetGenre(User.Genre genre)Sets the user's favorite genre.voidsetOauth(java.lang.String oauth)Sets the user's OAuth 2.0 key.voidsetUsername(java.lang.String username)Sets the user's username.
-
-
-
Method Detail
-
getId
public java.lang.Long getId()
Returns the id for the user.- Returns:
-
getUsername
@NonNull public java.lang.String getUsername()
Returns the user's username.- Returns:
-
setUsername
public void setUsername(@NonNull java.lang.String username)Sets the user's username.- Parameters:
username- String
-
getEmail
@NonNull public java.lang.String getEmail()
Returns the user's email address.- Returns:
-
setEmail
public void setEmail(@NonNull java.lang.String email)Sets the user's email address.- Parameters:
email- String
-
getGenre
public User.Genre getGenre()
Returns the user's favorite genre as an enumerated type from theUser.Genreenum.- Returns:
-
setGenre
public void setGenre(User.Genre genre)
Sets the user's favorite genre.- Parameters:
genre- an enumerated value fromUser.Genre
-
getOauth
@NonNull public java.lang.String getOauth()
Returns the user's OAuth 2.0 key.- Returns:
-
setOauth
public void setOauth(@NonNull java.lang.String oauth)Sets the user's OAuth 2.0 key.- Parameters:
oauth- String
-
getRelationshipsInitiated
@NonNull public java.util.List<Relationship> getRelationshipsInitiated()
Returns the list of relationships that the user has initiated.- Returns:
-
getRelationshipsReceived
@NonNull public java.util.List<Relationship> getRelationshipsReceived()
Returns the list of relationships that the user has received requests for.- Returns:
-
getClips
@NonNull public java.util.List<Clip> getClips()
Returns the list of clips posted by the user.- Returns:
-
-