Package com.atlassian.jira.jql.util
Class JqlLocalDateSupportImpl
java.lang.Object
com.atlassian.jira.jql.util.JqlLocalDateSupportImpl
- All Implemented Interfaces:
JqlLocalDateSupport
@ThreadSafe
public final class JqlLocalDateSupportImpl
extends Object
implements JqlLocalDateSupport
Default implementation for
JqlLocalDateSupport- Since:
- v4.4
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionJqlLocalDateSupportImpl(TimeZoneManager timeZoneManager) JqlLocalDateSupportImpl(Clock clock, TimeZoneManager timeZoneManager) -
Method Summary
Modifier and TypeMethodDescriptionconvertToDate(LocalDate date) Converts a LocalDate to a Date using the systems time zone.convertToLocalDate(Long dateLong) Try to parse the passed date long.convertToLocalDate(String dateString) Try to parse the passed date string using the formats that JQL understands.getLocalDateFromQueryLiteral(QueryLiteral rawValue) Try to parse the passed date in query literal.getLocalDatesFromQueryLiterals(List<QueryLiteral> rawValues) Try to parse the passed dates in query literals.getLocalDateString(LocalDate localDate) Return a string representation of the passed date.booleanCheck to see if the passed string is a valid date according to JQL.
-
Field Details
-
PATTERN_WITH_SLASH
- See Also:
-
PATTERN_WITH_HYPHEN
- See Also:
-
-
Constructor Details
-
JqlLocalDateSupportImpl
-
JqlLocalDateSupportImpl
-
-
Method Details
-
convertToLocalDate
Description copied from interface:JqlLocalDateSupportTry to parse the passed date string using the formats that JQL understands. It will consider the user's time zone when parsing the date string.- Specified by:
convertToLocalDatein interfaceJqlLocalDateSupport- Parameters:
dateString- the string to parse. Cannot be empty or null.- Returns:
- the parsed date.
-
convertToLocalDate
Description copied from interface:JqlLocalDateSupportTry to parse the passed date long.- Specified by:
convertToLocalDatein interfaceJqlLocalDateSupport- Parameters:
dateLong- the string to parse. Cannot be empty or null.- Returns:
- the parsed date.
-
validate
Description copied from interface:JqlLocalDateSupportCheck to see if the passed string is a valid date according to JQL.- Specified by:
validatein interfaceJqlLocalDateSupport- Parameters:
dateString- the string to check cannot be null.- Returns:
- true if the date is valid; false otherwise.
-
getLocalDateString
Description copied from interface:JqlLocalDateSupportReturn a string representation of the passed date. This method should just convert the date into its parseable String representation.- Specified by:
getLocalDateStringin interfaceJqlLocalDateSupport- Parameters:
localDate- the date to convert. Cannot be null.- Returns:
- return the passed date as a string.
-
convertToDate
Description copied from interface:JqlLocalDateSupportConverts a LocalDate to a Date using the systems time zone.- Specified by:
convertToDatein interfaceJqlLocalDateSupport- Parameters:
date- the date to convert. Cannot be null.- Returns:
- return the Date for the local date.
-
getLocalDateFromQueryLiteral
Description copied from interface:JqlLocalDateSupportTry to parse the passed date in query literal.- Specified by:
getLocalDateFromQueryLiteralin interfaceJqlLocalDateSupport- Parameters:
rawValue- the query literal representing the date- Returns:
- a date represented by the literals
-
getLocalDatesFromQueryLiterals
Description copied from interface:JqlLocalDateSupportTry to parse the passed dates in query literals.- Specified by:
getLocalDatesFromQueryLiteralsin interfaceJqlLocalDateSupport- Parameters:
rawValues- the query literals representing the dates- Returns:
- a list of dates represented by the literals; never null, but may contain null if an empty literal was specified.
-