Class StatisticsSolrDateFilter
java.lang.Object
org.dspace.statistics.content.filter.StatisticsSolrDateFilter
- All Implemented Interfaces:
StatisticsFilter
Encapsulate a range of dates for Solr query filtering.
- Author:
- Kevin Van de Velde (kevin at atmire dot com)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidsetEndDate(LocalDateTime endDate) Set the end date as a Date object.voidSet the end date as a string expression.voidsetStartDate(LocalDateTime 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.toQuery()Convert the date range to a filter expression.
-
Constructor Details
-
StatisticsSolrDateFilter
public StatisticsSolrDateFilter()
-
-
Method Details
-
setStartStr
Set the start date as a string expression.- Parameters:
startStr- statistics start date as a string Must be paired withsetEndStr(String).
-
setEndStr
Set the end date as a string expression.- Parameters:
endStr- statistics end date as a string Must be paired withsetStartStr(String).
-
setTypeStr
Set the range granularity: DAY, MONTH, or YEAR.- Parameters:
typeStr- which granularity (case insensitive string: "day" / "month" / "year")
-
setStartDate
Set the start date as a Date object.- Parameters:
startDate- statistics start date object Must be paired withsetEndDate(LocalDateTime).
-
setEndDate
Set the end date as a Date object.- Parameters:
endDate- statistics end date object Must be paired withsetStartDate(LocalDateTime).
-
toQuery
Convert the date range to a filter expression.- Specified by:
toQueryin interfaceStatisticsFilter- Returns:
- Solr date filter expression
-