Class User

  • All Implemented Interfaces:
    java.lang.Comparable<User>

    @Entity
    public class User
    extends java.lang.Object
    implements java.lang.Comparable<User>

    The User entity 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 User entity contains the nested enum User.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 class  User.Genre
      The Genre enum 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
      int compareTo​(User other)  
      java.util.List<Clip> getClips()
      Returns the list of clips posted by the user.
      java.lang.String getEmail()
      Returns the user's email address.
      User.Genre getGenre()
      Returns the user's favorite genre as an enumerated type from the User.Genre enum.
      java.lang.Long getId()
      Returns the id for the user.
      java.lang.String getOauth()
      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.String getUsername()
      Returns the user's username.
      void setEmail​(java.lang.String email)
      Sets the user's email address.
      void setGenre​(User.Genre genre)
      Sets the user's favorite genre.
      void setOauth​(java.lang.String oauth)
      Sets the user's OAuth 2.0 key.
      void setUsername​(java.lang.String username)
      Sets the user's username.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • User

        public User()
    • 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 the User.Genre enum.
        Returns:
      • setGenre

        public void setGenre​(User.Genre genre)
        Sets the user's favorite genre.
        Parameters:
        genre - an enumerated value from User.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:
      • compareTo

        public int compareTo​(User other)
        Specified by:
        compareTo in interface java.lang.Comparable<User>