com.atlassian.jira.jql.util
Interface JqlDateSupport

All Known Implementing Classes:
JqlDateSupportImpl

public interface JqlDateSupport

Interface that helps with date parsing and validation in JQL.

Since:
v4.0

Method Summary
 java.util.Date convertToDate(java.lang.Long dateLong)
          Try to parse the passed date long.
 java.util.Date convertToDate(java.lang.String dateString)
          Try to parse the passed date string using the formats that JQL understands.
 java.lang.String getDateString(java.util.Date date)
          Return a string representation of the passed date.
 java.lang.String getIndexedValue(java.util.Date date)
          Converts a date into the index-friendly format.
 boolean validate(java.lang.String dateString)
          Check to see if the passed string is a valid date according to JQL.
 

Method Detail

convertToDate

java.util.Date convertToDate(java.lang.String dateString)
Try to parse the passed date string using the formats that JQL understands.

Parameters:
dateString - the string to parse. Cannot be empty or null.
Returns:
the parsed date.
Throws:
java.lang.IllegalArgumentException - if the passed dateString is blank or null.

convertToDate

java.util.Date convertToDate(java.lang.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:
java.lang.IllegalArgumentException - if the passed dateString is blank or null.

getIndexedValue

java.lang.String getIndexedValue(java.util.Date date)
Converts a date into the index-friendly format.

Parameters:
date - the date
Returns:
a string representing the date, ready for comparison to indexed values.

validate

boolean validate(java.lang.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:
java.lang.IllegalArgumentException - if the passed dateString is blank or null

getDateString

java.lang.String getDateString(java.util.Date 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:
java.lang.IllegalArgumentException - if the passed date is null.


Copyright © 2002-2011 Atlassian. All Rights Reserved.