| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- package fr.jaquin.bdlg.planner.domain;
- import java.time.LocalDateTime;
- import org.optaplanner.core.api.domain.entity.PlanningEntity;
- import org.optaplanner.core.api.domain.variable.PlanningVariable;
- @PlanningEntity
- public class MealAssignement {
- private int id;
- private Volonteer volonteer;
- @PlanningVariable(valueRangeProviderRefs = "mealslotRange")
- private MealSlot mealSlot;
- public MealAssignement(){}
- public MealAssignement(Volonteer volonteer) {
- this.volonteer = volonteer;
- }
- public MealAssignement(int id, MealSlot MealSlot, Volonteer volonteer) {
- this.id = id;
- this.volonteer = volonteer;
- this.mealSlot = MealSlot;
- }
- // ********************************
- // Getters and setters
- // ********************************
- public int getId() {
- return this.id;
- }
- public Volonteer getVolonteer() {
- return this.volonteer;
- }
- public void setVolonteer(Volonteer volonteer) {
- this.volonteer = volonteer;
- }
- public MealSlot getMealSlot() {
- return this.mealSlot;
- }
- public void setMealSlot(MealSlot MealSlot) {
- this.mealSlot = MealSlot;
- }
- public LocalDateTime getStartDateTime() {
- if(this.mealSlot==null){
- return LocalDateTime.MIN;
- }
- return this.mealSlot.getStartTime();
- }
- public LocalDateTime getEndDateTime() {
- if(this.mealSlot==null){
- return LocalDateTime.MIN;
- }
- return this.mealSlot.getEndTime();
- }
- @Override
- public String toString() {
- return "MealAssignement[volunteer=" + this.volonteer.getId().toString() + "]";
- }
- }
|