Advertisement
Guest User

Utente

a guest
Jun 5th, 2016
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. package ufficio;
  2.  
  3. import java.io.*;
  4. import java.util.*;
  5.  
  6. /**
  7. *
  8. * @author 627166
  9. *
  10. */
  11. class Utente {
  12.  
  13. /* Attributi */
  14. private String username;
  15. private String password;
  16. private boolean add = false;
  17. private boolean create = false;
  18. private boolean remove = false;
  19.  
  20. /**
  21. * Creazione utente che richiede obbligatoriamente username e password
  22. * @param username
  23. * @param password
  24. */
  25. public Utente (String username, String password) throws UtenteEsistenteException
  26. {
  27. if (username.contains(username))
  28. {
  29. throw new UtenteEsistenteException();
  30. }
  31. else
  32. {
  33. this.username = username;
  34. this.password = password;
  35. }
  36. }
  37.  
  38. /**
  39. *
  40. * @return
  41. */
  42. public String username ()
  43. {
  44. return username;
  45. }
  46.  
  47. /**
  48. *
  49. * @return
  50. */
  51. public String password ()
  52. {
  53. return password;
  54. }
  55.  
  56. /**
  57. * Metodo per eventuale privilegio di aggiungere utente
  58. * @param add
  59. * @return
  60. */
  61. public boolean addUtente (boolean add)
  62. {
  63. return add;
  64. }
  65.  
  66. /**
  67. * Metodo per eventuale privilegio di creazione utente
  68. * @param create
  69. * @return
  70. */
  71. public boolean createUtente (boolean create)
  72. {
  73. return create;
  74. }
  75.  
  76. /**
  77. * Metodo per eventuale privilegio di rimuovere utente
  78. * @param remove
  79. * @return
  80. */
  81. public boolean removeUtente (boolean remove)
  82. {
  83. return remove;
  84. }
  85.  
  86. // End
  87. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement