Class StatisticsSolrDateFilter

java.lang.Object
org.dspace.statistics.content.filter.StatisticsSolrDateFilter
All Implemented Interfaces:
StatisticsFilter

public class StatisticsSolrDateFilter extends Object implements StatisticsFilter
Encapsulate a range of dates for Solr query filtering.
Author:
Kevin Van de Velde (kevin at atmire dot com)
  • Constructor Details

    • StatisticsSolrDateFilter

      public StatisticsSolrDateFilter()
  • Method Details

    • setStartStr

      public void setStartStr(String startStr)
      Set the start date as a string expression.
      Parameters:
      startStr - statistics start date as a string Must be paired with setEndStr(String).
    • setEndStr

      public void setEndStr(String endStr)
      Set the end date as a string expression.
      Parameters:
      endStr - statistics end date as a string Must be paired with setStartStr(String).
    • setTypeStr

      public void setTypeStr(String typeStr)
      Set the range granularity: DAY, MONTH, or YEAR.
      Parameters:
      typeStr - which granularity (case insensitive string: "day" / "month" / "year")
    • setStartDate

      public void setStartDate(LocalDateTime startDate)
      Set the start date as a Date object.
      Parameters:
      startDate - statistics start date object Must be paired with setEndDate(LocalDateTime).
    • setEndDate

      public void setEndDate(LocalDateTime endDate)
      Set the end date as a Date object.
      Parameters:
      endDate - statistics end date object Must be paired with setStartDate(LocalDateTime).
    • toQuery

      public String toQuery()
      Convert the date range to a filter expression.
      Specified by:
      toQuery in interface StatisticsFilter
      Returns:
      Solr date filter expression