com.atlassian.jira.jql.util
Class JqlDateSupportImpl

java.lang.Object
  extended by com.atlassian.jira.jql.util.JqlDateSupportImpl
All Implemented Interfaces:
JqlDateSupport

@ThreadSafe
public final class JqlDateSupportImpl
extends Object
implements JqlDateSupport

Default implementation for JqlDateSupport

Since:
v4.0

Constructor Summary
JqlDateSupportImpl()
           
JqlDateSupportImpl(com.atlassian.core.util.Clock clock)
           
 
Method Summary
 Date convertToDate(Long dateLong)
          Try to parse the passed date long.
 Date convertToDate(String dateString)
          Try to parse the passed date string using the formats that JQL understands.
 String getDateString(Date date)
          Return a string representation of the passed date.
static String getDurationString(long duration)
           
 String getIndexedValue(Date date)
          Converts a date into the index-friendly format.
 boolean validate(String dateString)
          Check to see if the passed string is a valid date according to JQL.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JqlDateSupportImpl

public JqlDateSupportImpl(com.atlassian.core.util.Clock clock)

JqlDateSupportImpl

public JqlDateSupportImpl()
Method Detail

convertToDate

public Date convertToDate(String dateString)
Description copied from interface: JqlDateSupport
Try to parse the passed date string using the formats that JQL understands.

Specified by:
convertToDate in interface JqlDateSupport
Parameters:
dateString - the string to parse. Cannot be empty or null.
Returns:
the parsed date.

convertToDate

public Date convertToDate(Long dateLong)
Description copied from interface: JqlDateSupport
Try to parse the passed date long.

Specified by:
convertToDate in interface JqlDateSupport
Parameters:
dateLong - the string to parse. Cannot be empty or null.
Returns:
the parsed date.

getIndexedValue

public String getIndexedValue(Date date)
Description copied from interface: JqlDateSupport
Converts a date into the index-friendly format.

Specified by:
getIndexedValue in interface JqlDateSupport
Parameters:
date - the date
Returns:
a string representing the date, ready for comparison to indexed values.

validate

public boolean validate(String dateString)
Description copied from interface: JqlDateSupport
Check to see if the passed string is a valid date according to JQL.

Specified by:
validate in interface JqlDateSupport
Parameters:
dateString - the string to check cannot be null.
Returns:
true if the date is valid; false otherwise.

getDateString

public String getDateString(Date date)
Description copied from interface: JqlDateSupport
Return a string representation of the passed date. This method should just convert the date into its parseable String representation.

Specified by:
getDateString in interface JqlDateSupport
Parameters:
date - the date to convert. Cannot be null.
Returns:
return the passed date as a string.

getDurationString

public static String getDurationString(long duration)


Copyright © 2002-2009 Atlassian. All Rights Reserved.