Advertisement
Guest User

Untitled

a guest
Aug 16th, 2015
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.39 KB | None | 0 0
  1. package ManagedBean;
  2.  
  3. import javax.faces.bean.ManagedBean;
  4. import javax.faces.bean.RequestScoped;
  5.  
  6. @ManagedBean
  7. @RequestScoped
  8. public class Usuario {
  9. private static int contador = 0;
  10. private int id;
  11. private String username;
  12. private String password;
  13. private String nombres;
  14. private String apellidoMaterno;
  15. private String apellidoPaterno;
  16. private int edad;
  17. private String sexo;
  18. private String ciudad;
  19.  
  20. public Usuario() {
  21. this.setId(contador++);
  22. }
  23.  
  24. public int getId() {
  25. return id;
  26. }
  27.  
  28. public void setId(int id) {
  29. this.id = id;
  30. }
  31.  
  32. public String getUsername() {
  33. return username;
  34. }
  35.  
  36. public void setUsername(String username) {
  37. this.username = username;
  38. }
  39.  
  40. public String getPassword() {
  41. return password;
  42. }
  43.  
  44. public void setPassword(String password) {
  45. this.password = password;
  46. }
  47.  
  48. public String getNombres() {
  49. return nombres;
  50. }
  51.  
  52. public void setNombres(String nombres) {
  53. this.nombres = nombres;
  54. }
  55.  
  56. public String getApellidoMaterno() {
  57. return apellidoMaterno;
  58. }
  59.  
  60. public void setApellidoMaterno(String apellidoMaterno) {
  61. this.apellidoMaterno = apellidoMaterno;
  62. }
  63.  
  64. public String getApellidoPaterno() {
  65. return apellidoPaterno;
  66. }
  67.  
  68. public void setApellidoPaterno(String apellidoPaterno) {
  69. this.apellidoPaterno = apellidoPaterno;
  70. }
  71.  
  72. public int getEdad() {
  73. return edad;
  74. }
  75.  
  76. public void setEdad(int edad) {
  77. this.edad = edad;
  78. }
  79.  
  80. public String getSexo() {
  81. return sexo;
  82. }
  83.  
  84. public void setSexo(String sexo) {
  85. this.sexo = sexo;
  86. }
  87.  
  88. public String getCiudad() {
  89. return ciudad;
  90. }
  91.  
  92. public void setCiudad(String ciudad) {
  93. this.ciudad = ciudad;
  94. }
  95.  
  96. @Override
  97. public int hashCode() {
  98. int hash = 5;
  99. hash = 47 * hash + this.id;
  100. return hash;
  101. }
  102.  
  103. @Override
  104. public boolean equals(Object obj) {
  105. if (obj == null) {
  106. return false;
  107. }
  108. if (getClass() != obj.getClass()) {
  109. return false;
  110. }
  111. final Usuario other = (Usuario) obj;
  112. if (this.id != other.id) {
  113. return false;
  114. }
  115. return true;
  116. }
  117. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement