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 Summary
Constructors Constructor Description StatisticsSolrDateFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidsetEndDate(Date endDate)Set the end date as a Date object.voidsetEndStr(String endStr)Set the end date as a string expression.voidsetStartDate(Date startDate)Set the start date as a Date object.voidsetStartStr(String startStr)Set the start date as a string expression.voidsetTypeStr(String typeStr)Set the range granularity: DAY, MONTH, or YEAR.StringtoQuery()Convert the date range to a filter expression.
-
-
-
Method Detail
-
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 withsetEndStr(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 withsetStartStr(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(Date startDate)
Set the start date as a Date object.- Parameters:
startDate- statistics start date object Must be paired withsetEndDate(Date).
-
setEndDate
public void setEndDate(Date endDate)
Set the end date as a Date object.- Parameters:
endDate- statistics end date object Must be paired withsetStartDate(Date).
-
toQuery
public String toQuery()
Convert the date range to a filter expression.- Specified by:
toQueryin interfaceStatisticsFilter- Returns:
- Solr date filter expression
-
-