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 Details

  • Constructor Details

    • JqlLocalDateSupportImpl

      public JqlLocalDateSupportImpl(Clock clock, TimeZoneManager timeZoneManager)
    • JqlLocalDateSupportImpl

      public JqlLocalDateSupportImpl(TimeZoneManager timeZoneManager)
  • Method Details

    • convertToLocalDate

      public LocalDate convertToLocalDate(String dateString)
      Description copied from interface: JqlLocalDateSupport
      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.
      Specified by:
      convertToLocalDate in interface JqlLocalDateSupport
      Parameters:
      dateString - the string to parse. Cannot be empty or null.
      Returns:
      the parsed date.
    • convertToLocalDate

      public LocalDate convertToLocalDate(Long dateLong)
      Description copied from interface: JqlLocalDateSupport
      Try to parse the passed date long.
      Specified by:
      convertToLocalDate in interface JqlLocalDateSupport
      Parameters:
      dateLong - the string to parse. Cannot be empty or null.
      Returns:
      the parsed date.
    • validate

      public boolean validate(String dateString)
      Description copied from interface: JqlLocalDateSupport
      Check to see if the passed string is a valid date according to JQL.
      Specified by:
      validate in interface JqlLocalDateSupport
      Parameters:
      dateString - the string to check cannot be null.
      Returns:
      true if the date is valid; false otherwise.
    • getLocalDateString

      public String getLocalDateString(LocalDate localDate)
      Description copied from interface: JqlLocalDateSupport
      Return a string representation of the passed date. This method should just convert the date into its parseable String representation.
      Specified by:
      getLocalDateString in interface JqlLocalDateSupport
      Parameters:
      localDate - the date to convert. Cannot be null.
      Returns:
      return the passed date as a string.
    • convertToDate

      public Date convertToDate(LocalDate date)
      Description copied from interface: JqlLocalDateSupport
      Converts a LocalDate to a Date using the systems time zone.
      Specified by:
      convertToDate in interface JqlLocalDateSupport
      Parameters:
      date - the date to convert. Cannot be null.
      Returns:
      return the Date for the local date.
    • getLocalDateFromQueryLiteral

      public LocalDate getLocalDateFromQueryLiteral(QueryLiteral rawValue)
      Description copied from interface: JqlLocalDateSupport
      Try to parse the passed date in query literal.
      Specified by:
      getLocalDateFromQueryLiteral in interface JqlLocalDateSupport
      Parameters:
      rawValue - the query literal representing the date
      Returns:
      a date represented by the literals
    • getLocalDatesFromQueryLiterals

      public List<LocalDate> getLocalDatesFromQueryLiterals(List<QueryLiteral> rawValues)
      Description copied from interface: JqlLocalDateSupport
      Try to parse the passed dates in query literals.
      Specified by:
      getLocalDatesFromQueryLiterals in interface JqlLocalDateSupport
      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.