Volunteer.java 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. package fr.jaquin.bdlg.planner.domain;
  2. import java.util.Objects;
  3. import java.util.Set;
  4. public class Volunteer {
  5. private Long id;
  6. private Set<Skill> competencies;
  7. private Set<Skill> preferences;
  8. public Volunteer(Long id, Set<Skill> competencies, Set<Skill> preferences) {
  9. this.id = id;
  10. this.competencies = competencies;
  11. this.preferences = preferences;
  12. }
  13. // ********************************
  14. // Getters and setters
  15. // ********************************
  16. public Long getId() {
  17. return this.id;
  18. }
  19. public Set<Skill> getCompetencies() {
  20. return this.competencies;
  21. }
  22. public Set<Skill> getPreferences() {
  23. return this.preferences;
  24. }
  25. @Override
  26. public boolean equals(Object o) {
  27. if (o == this)
  28. return true;
  29. if (!(o instanceof Volunteer)) {
  30. return false;
  31. }
  32. Volunteer volonteer = (Volunteer) o;
  33. return id.equals(volonteer.id);
  34. }
  35. @Override
  36. public int hashCode() {
  37. return Objects.hash(id);
  38. }
  39. @Override
  40. public String toString() {
  41. return "Volunteer[id=" + this.id + "]";
  42. }
  43. }