Timeslot.java 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. package fr.jaquin.bdlg.planner.domain;
  2. import java.time.LocalDateTime;
  3. import java.util.Set;
  4. public class Timeslot {
  5. private String id;
  6. private LocalDateTime startTime;
  7. private LocalDateTime endTime;
  8. private Set<Skill> softCompetencies;
  9. private Set<Skill> hardCompetencies;
  10. private Set<Skill> preferences;
  11. private int minAttendee;
  12. public Timeslot(String id, LocalDateTime startTime, LocalDateTime endTime,
  13. Set<Skill> softCompetencies, Set<Skill> hardCompetencies, Set<Skill> preferences,
  14. int minAttendee) {
  15. this.id = id;
  16. this.startTime = startTime;
  17. this.endTime = endTime;
  18. this.softCompetencies = softCompetencies;
  19. this.hardCompetencies = hardCompetencies;
  20. this.preferences = preferences;
  21. this.minAttendee = minAttendee;
  22. }
  23. @Override
  24. public String toString() {
  25. return this.id + " from " + startTime.toString() + " to " + endTime.toString();
  26. }
  27. // ********************************
  28. // Getters and setters
  29. // ********************************
  30. public String getId() {
  31. return this.id;
  32. }
  33. public LocalDateTime getStartTime() {
  34. return this.startTime;
  35. }
  36. public LocalDateTime getEndTime() {
  37. return this.endTime;
  38. }
  39. public Set<Skill> getSoftCompetencies() {
  40. return this.softCompetencies;
  41. }
  42. public Set<Skill> getHardCompetencies() {
  43. return this.hardCompetencies;
  44. }
  45. public Set<Skill> getPreferences() {
  46. return this.preferences;
  47. }
  48. public int getMinAttendee() {
  49. return this.minAttendee;
  50. }
  51. @Override
  52. public boolean equals(Object o) {
  53. if (o == this)
  54. return true;
  55. if (!(o instanceof Timeslot)) {
  56. return false;
  57. }
  58. Timeslot competency = (Timeslot) o;
  59. return id.equals(competency.id);
  60. }
  61. }