Guest User

Untitled

a guest
Oct 19th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.77 KB | None | 0 0
  1. public class Ong {
  2. private String nome;
  3.  
  4. private String descricao;
  5.  
  6. private List<Voluntarios> listaVoluntarios = new ArrayList<Voluntarios>();
  7.  
  8.  
  9. /* (non-Javadoc)
  10. * @see java.lang.Object#hashCode()
  11. */
  12. @Override
  13. public int hashCode() {
  14. final int prime = 31;
  15. int result = 1;
  16. result = prime
  17. * result
  18. + ((listaVoluntarios == null) ? 0 : listaVoluntarios.hashCode());
  19. return result;
  20. }
  21.  
  22. /* (non-Javadoc)
  23. * @see java.lang.Object#equals(java.lang.Object)
  24. */
  25. @Override
  26. public boolean equals(Object obj) {
  27. if (this == obj)
  28. return true;
  29. if (obj == null)
  30. return false;
  31. if (getClass() != obj.getClass())
  32. return false;
  33. Ong other = (Ong) obj;
  34. if (listaVoluntarios == null) {
  35. if (other.listaVoluntarios != null)
  36. return false;
  37. } else if (!listaVoluntarios.equals(other.listaVoluntarios))
  38. return false;
  39. return true;
  40. }
  41.  
  42. /**
  43. * @return the nome
  44. */
  45. public String getNome() {
  46. return nome;
  47. }
  48.  
  49. /**
  50. * @param nome the nome to set
  51. */
  52. public void setNome(String nome) {
  53. this.nome = nome;
  54. }
  55.  
  56. /**
  57. * @return the descricao
  58. */
  59. public String getDescricao() {
  60. return descricao;
  61. }
  62.  
  63. /**
  64. * @param descricao the descricao to set
  65. */
  66. public void setDescricao(String descricao) {
  67. this.descricao = descricao;
  68. }
  69.  
  70. /**
  71. * @return the listaVoluntarios
  72. */
  73. public List<Voluntarios> getListaVoluntarios() {
  74. return listaVoluntarios;
  75. }
  76.  
  77. /**
  78. * @param listaVoluntarios the listaVoluntarios to set
  79. */
  80. public void setListaVoluntarios(List<Voluntarios> listaVoluntarios) {
  81. this.listaVoluntarios = listaVoluntarios;
  82. }
  83.  
  84. /* (non-Javadoc)
  85. * @see java.lang.Object#toString()
  86. */
  87. @Override
  88. public String toString() {
  89. return "Ong [nome=" + getNome() + ", descricao=" + getDescricao()
  90. + ", listaVoluntarios=" + getListaVoluntarios() + "]";
  91. }
  92.  
  93. }
Add Comment
Please, Sign In to add comment