public final class SolrUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static Function<String,Option<String>> |
clean
clean(String) as a function. |
static Function<Date,String> |
serializeDate
serializeDate(java.util.Date) as a function. |
| Modifier and Type | Method and Description |
|---|---|
static String |
clean(String q)
Clean up the user query input string to avoid invalid input parameters.
|
static DateFormat |
newSolrDateFormat()
Return a date format suitable for solr.
|
static Date |
parseDate(String date)
Returns the date or
null if null was passed in for the date. |
static String |
serializeDate(Date date)
Returns a serialized version of the date or
null if null was passed in for the date. |
static String |
serializeDateRange(Option<Date> startDate,
Option<Date> endDate)
Returns an expression to search for any date that lies in between
startDate and endDate. |
public static final Function<String,Option<String>> clean
clean(String) as a function. Return none if string is empty after cleaning.public static final Function<Date,String> serializeDate
serializeDate(java.util.Date) as a function.public static String clean(String q)
q - The input String.public static String serializeDate(Date date)
null if null was passed in for the date.date - the datepublic static Date parseDate(String date) throws ParseException
null if null was passed in for the date.date - the serialized date in UTC format yyyy-MM-dd'T'HH:mm:ss'Z'ParseException - if parsing the date failspublic static String serializeDateRange(Option<Date> startDate, Option<Date> endDate)
startDate and endDate.startDate - the start date or none for an infinite left endpoint, "*" in solr query syntaxendDate - the end date or none for an infinite right endpoint, "*" in solr query syntaxpublic static DateFormat newSolrDateFormat()
yyyy-MM-dd'T'HH:mm:ss'Z'Copyright © 2009–2021 Opencast Project. All rights reserved.