package com.amee.domain;

import java.util.Date;

public class ProfileItemsFilter extends LimitFilter {

    private Date startDate = new Date();
    private Date endDate = null;

    /**
     * Setting this to 'start' will only include items which start during the query window.
     * Setting 'end' will include only items which end during the window.
     * The default behaviour is to include any item that intersects the query window.
     */
    private String selectBy;

    /**
     * Set the calculation mode used. By default, emission values for items are for the whole item,
     * not just the part of the item that intersects the query window. To get just the emissions that took place
     * during the query window, set this parameter to 'prorata'.
     */
    private String mode;

    @Override
    public int getResultLimitDefault() {
        return 50;
    }

    @Override
    public int getResultLimitMax() {
        return 100;
    }

    public Date getEndDate() {
        return endDate;
    }

    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    public Date getStartDate() {
        return startDate;
    }

    public void setStartDate(Date startDate) {
        if (startDate != null) {
            this.startDate = startDate;
        }
    }

    public String getSelectBy() {
        return selectBy;
    }

    public void setSelectBy(String selectBy) {
        this.selectBy = selectBy;
    }

    public String getMode() {
        return mode;
    }

    public void setMode(String mode) {
        this.mode = mode;
    }
}

@@ -30,18 +30,42 @@
 ort 
-java.util.
+com.amee.platform.science.StartEnd
 Date
@@ -130,24 +130,32 @@
     private 
+StartEnd
 Date startDa
@@ -163,16 +163,24 @@
 e = new 
+StartEnd
 Date();%0A
@@ -191,16 +191,24 @@
 private 
+StartEnd
 Date end
@@ -219,16 +219,45 @@
  = null;
+%0A    private String duration;
 %0A%0A    /*
@@ -1030,32 +1030,40 @@
   %7D%0A%0A    public 
+StartEnd
 Date getEndDate(
@@ -1078,23 +1078,128 @@
     
-return endDate;
+if (endDate != null) %7B%0A            return new StartEndDate(endDate);%0A        %7D else %7B%0A            return null;%0A        %7D
 %0A   
@@ -1225,24 +1225,32 @@
  setEndDate(
+StartEnd
 Date endDate
@@ -1303,16 +1303,24 @@
  public 
+StartEnd
 Date get
@@ -1348,16 +1348,33 @@
  return 
+new StartEndDate(
 startDat
@@ -1370,24 +1370,25 @@
 te(startDate
+)
 ;%0A    %7D%0A%0A   
@@ -1413,16 +1413,24 @@
 artDate(
+StartEnd
 Date sta
@@ -1521,32 +1521,186 @@
        %7D%0A    %7D%0A%0A
+    public String getDuration() %7B%0A        return duration;%0A    %7D%0A%0A    public void setDuration(String duration) %7B%0A        this.duration = duration;%0A    %7D%0A%0A
     public Strin

Use StartEndDates in ProfileItemsFilter. PL-11213.