Advertisement
Guest User

organizador

a guest
May 22nd, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.66 KB | None | 0 0
  1. public class Organizador
  2. {
  3.  
  4. /**
  5. * O nome do utilizador
  6. */
  7. private String nome;
  8.  
  9. /**
  10. * O email do utilizador
  11. */
  12. private String email;
  13.  
  14. /**
  15. * O username do utilizador
  16. */
  17. private String username;
  18.  
  19. /**
  20. * A password do utilizador
  21. */
  22. private String password;
  23.  
  24. /**
  25. * O nome do utilizador por omissao
  26. */
  27. private static final String NOME_POR_OMISSAO = "";
  28.  
  29. /**
  30. * O email do utilizador por omissao
  31. */
  32. private static final String EMAIL_POR_OMISSAO = "";
  33.  
  34. /**
  35. * O username do utilizador por omissao
  36. */
  37. private static final String USERNAME_POR_OMISSAO = "";
  38.  
  39. /**
  40. * A password do utilizador por omissao
  41. */
  42. private static final String PASSWORD_POR_OMISSAO = "";
  43.  
  44. /**
  45. * Constrói uma instância de Utilizador recebendo o nome, o email, o
  46. * username e a password do utilizador
  47. *
  48. * @param nome o nome do utilizador
  49. * @param email o email do utilizador
  50. * @param username o username do utilizador
  51. * @param password a password do utilizador
  52. */
  53. public Organizador(String nome, String email, String username, String password) {
  54. this.nome = nome;
  55. this.email = email;
  56. this.username = username;
  57. this.password = password;
  58. }
  59.  
  60. /**
  61. * Constrói uma instância de Candidatura com o nome, email, username e
  62. * password do utilizador por omissao
  63. */
  64. public Organizador() {
  65. nome = NOME_POR_OMISSAO;
  66. email = EMAIL_POR_OMISSAO;
  67. username = USERNAME_POR_OMISSAO;
  68. password = PASSWORD_POR_OMISSAO;
  69. }
  70.  
  71. /**
  72. * Devolve o nome do utilizador
  73. *
  74. * @return nome
  75. */
  76. private String getNome() {
  77. return nome;
  78. }
  79.  
  80. /**
  81. * Devolve o email do utilizador
  82. *
  83. * @return email
  84. */
  85. private String getEmail() {
  86. return email;
  87. }
  88.  
  89. /**
  90. * Devolve o username do utilizador
  91. *
  92. * @return username
  93. */
  94. private String getUsername() {
  95. return username;
  96. }
  97.  
  98. /**
  99. * Devolve a password do utilizador
  100. *
  101. * @return password
  102. */
  103. private String getPassword() {
  104. return password;
  105. }
  106.  
  107. /**
  108. * Modifica o nome do utilizador.
  109. *
  110. * @param nome
  111. */
  112. private void setNome(String nome) {
  113. this.nome = nome;
  114. }
  115.  
  116. /**
  117. * Modifica o email do utilizador.
  118. *
  119. * @param email
  120. */
  121. private void setEmail(String email) {
  122. this.email = email;
  123. }
  124.  
  125. /**
  126. * Modifica o username do utilizador.
  127. *
  128. * @param username
  129. */
  130. private void setUsername(String username) {
  131. this.username = username;
  132. }
  133.  
  134. /**
  135. * Modifica a password do utilizador.
  136. *
  137. * @param password
  138. */
  139. private void setPassword(String password) {
  140. this.password = password;
  141. }
  142.  
  143. public String toString() {
  144. return "O nome é " + nome + " o seu email é " + email + " o seu username" + username + " e a sua password " + password;
  145. }
  146.  
  147. @Override
  148. public boolean equals(Object obj) {
  149. Organizador other = (Organizador) obj;
  150. if (this == other) {
  151. return true;
  152. }
  153. if (this.nome != other.nome) {
  154. return false;
  155. }
  156. if (this.email != other.email) {
  157. return false;
  158. }
  159. if (this.password != other.password) {
  160. return false;
  161. }
  162.  
  163. if (this.username != other.username) {
  164. return false;
  165. }
  166.  
  167. return true;
  168. }
  169.  
  170. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement