Interface JqlLocalDateSupport

All Known Implementing Classes:
JqlLocalDateSupportImpl

public interface JqlLocalDateSupport
Interface that helps with LocalDate parsing and validation in JQL.
Since:
v4.4
See Also:
  • Method Details

    • convertToLocalDate

      LocalDate convertToLocalDate(String dateString)
      Try 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.
      Parameters:
      dateString - the string to parse. Cannot be empty or null.
      Returns:
      the parsed date.
      Throws:
      IllegalArgumentException - if the passed dateString is blank or null.
    • convertToLocalDate

      LocalDate convertToLocalDate(Long dateLong)
      Try to parse the passed date long.
      Parameters:
      dateLong - the string to parse. Cannot be empty or null.
      Returns:
      the parsed date.
      Throws:
      IllegalArgumentException - if the passed dateString is blank or null.
    • validate

      boolean validate(String dateString)
      Check to see if the passed string is a valid date according to JQL.
      Parameters:
      dateString - the string to check cannot be null.
      Returns:
      true if the date is valid; false otherwise.
      Throws:
      IllegalArgumentException - if the passed dateString is blank or null
    • getLocalDateString

      String getLocalDateString(LocalDate date)
      Return a string representation of the passed date. This method should just convert the date into its parseable String representation.
      Parameters:
      date - the date to convert. Cannot be null.
      Returns:
      return the passed date as a string.
      Throws:
      IllegalArgumentException - if the passed date is null.
    • convertToDate

      Date convertToDate(LocalDate date)
      Converts a LocalDate to a Date using the systems time zone.
      Parameters:
      date - the date to convert. Cannot be null.
      Returns:
      return the Date for the local date.
      Throws:
      IllegalArgumentException - if the passed date is null.
    • getLocalDateFromQueryLiteral

      LocalDate getLocalDateFromQueryLiteral(QueryLiteral rawValue)
      Try to parse the passed date in query literal.
      Parameters:
      rawValue - the query literal representing the date
      Returns:
      a date represented by the literals
    • getLocalDatesFromQueryLiterals

      List<LocalDate> getLocalDatesFromQueryLiterals(List<QueryLiteral> rawValues)
      Try to parse the passed dates in query literals.
      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.