/src/ChatAppServer/Account.java

https://bitbucket.org/blitz2145/cop4331-chat-application · Java · 87 lines · 46 code · 7 blank · 34 comment · 0 complexity · 532d8cc586f849c65d7b6c717e607368 MD5 · raw file

  1. package ChatAppServer;
  2. import java.net.InetAddress;
  3. public class Account {
  4. /**
  5. * Constructs an account represent a user on the server
  6. */
  7. public Account(String user, String pass, InetAddress ip, String em) {
  8. // TODO: Validate info checking for invalid usernames, etc.
  9. username = user;
  10. password = pass;
  11. ipAddress = ip;
  12. email = em;
  13. isLoggedIn = false;
  14. }
  15. /**
  16. * @return the username
  17. */
  18. public String getUsername() {
  19. return username;
  20. }
  21. /**
  22. * @param username the username to set
  23. */
  24. public void setUsername(String username) {
  25. this.username = username;
  26. }
  27. /**
  28. * @return the password
  29. */
  30. public String getPassword() {
  31. return password;
  32. }
  33. /**
  34. * @param password the password to set
  35. */
  36. public void setPassword(String password) {
  37. this.password = password;
  38. }
  39. /**
  40. * @return the ipAddress
  41. */
  42. public InetAddress getIpAddress() {
  43. return ipAddress;
  44. }
  45. /**
  46. * @param ipAddress the ipAddress to set
  47. */
  48. public void setIpAddress(InetAddress ipAddress) {
  49. this.ipAddress = ipAddress;
  50. }
  51. /**
  52. * @return the login status
  53. */
  54. public boolean getIsLoggedIn() {
  55. return isLoggedIn;
  56. }
  57. /**
  58. * @param status the login status to set
  59. */
  60. public void setIsLoggedIn(boolean status) {
  61. isLoggedIn = status;
  62. }
  63. /**
  64. * @return the email
  65. */
  66. public String getEmail() {
  67. return email;
  68. }
  69. /**
  70. * @param email the email to set
  71. */
  72. public void setEmail(String email) {
  73. this.email = email;
  74. }
  75. private boolean isLoggedIn;
  76. private String username;
  77. private String password;
  78. private String email;
  79. private InetAddress ipAddress;
  80. }