/*
 * myLazyClock
 *
 * Copyright (C) 2014
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package org.myLazyClock.model.bean;

import java.util.Date;

/**
 * Created on 16/11/14.
 *
 * @author Maxime
 */
public class AlarmClockEvent {

    private Date beginDate;
    private Long travelDuration;
    private String name;
    private String address;


    public Date getBeginDate() {
        return beginDate;
    }

    public Long getBeginDateTime() {
        return beginDate.getTime();
    }

    public void setBeginDate(Date beginDate) {
        this.beginDate = beginDate;
    }

    public Long getTravelDuration() {
        return travelDuration;
    }

    public String getTravelDurationString() {
        Long h = travelDuration/3600;
        Long m = (travelDuration-(h*3600))/60;
        Long s = travelDuration-(h*3600+m*60);
        if (h != 0)
            return h+" heure(s) et "+m+" minute(s)";
        else {
            return m+" minute(s)";
        }
    }

    public void setTravelDuration(Long travelDuration) {
        this.travelDuration = travelDuration;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }
}

@@ -748,16 +748,64 @@
 .bean;%0A%0A
+import org.myLazyClock.model.model.TravelMode;%0A%0A
 import j
@@ -901,16 +901,55 @@
 ockEvent
+ implements Comparable%3CAlarmClockEvent%3E
  %7B%0A%0A    
@@ -968,24 +968,50 @@
  beginDate;%0A
+    private Date endDate;%0A
     private 
@@ -1027,24 +1027,59 @@
 elDuration;%0A
+    private TravelMode travelMode;%0A
     private 
@@ -1349,32 +1349,176 @@
 ginDate;%0A    %7D%0A%0A
+    public Date getEndDate() %7B%0A        return endDate;%0A    %7D%0A%0A    public void setEndDate(Date endDate) %7B%0A        this.endDate = endDate;%0A    %7D%0A%0A
     public Long 
@@ -1997,32 +1997,206 @@
 uration;%0A    %7D%0A%0A
+    public TravelMode getTravelMode() %7B%0A        return travelMode;%0A    %7D%0A%0A    public void setTravelMode(TravelMode travelMode) %7B%0A        this.travelMode = travelMode;%0A    %7D%0A%0A
     public Strin
@@ -2455,11 +2455,127 @@
 s;%0A    %7D
+%0A%0A    @Override%0A    public int compareTo(AlarmClockEvent o) %7B%0A        return beginDate.compareTo(o.beginDate);%0A    %7D
 %0A%7D%0A

add endDate of event in AlarmClockEvent