com.atlassian.jira.jql.util
Class JqlTimetrackingDurationSupportImpl

java.lang.Object
  extended by com.atlassian.jira.jql.util.JqlTimetrackingDurationSupportImpl
All Implemented Interfaces:
IndexValueConverter, JqlTimetrackingDurationSupport

@InjectableComponent
public class JqlTimetrackingDurationSupportImpl
extends Object
implements JqlTimetrackingDurationSupport

The default implementation of JqlTimetrackingDurationSupport

Since:
v4.0

Constructor Summary
JqlTimetrackingDurationSupportImpl(JiraDurationUtils durationUtils)
           
 
Method Summary
 Long convertToDuration(Long durationInMinutes)
          Convenience method.
 Long convertToDuration(String durationString)
          Converts the formatted duration string into its duration in seconds.
protected  String convertToIndexValue(Long durationInMinutes)
          Convenience method.
 String convertToIndexValue(QueryLiteral rawValue)
           
protected  String convertToIndexValue(String durationString)
          Converts the specified duration into the format used by the index.
 boolean validate(String durationString)
          Check to see if the passed string is a valid duration according to JQL.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JqlTimetrackingDurationSupportImpl

public JqlTimetrackingDurationSupportImpl(JiraDurationUtils durationUtils)
Method Detail

validate

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

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

convertToIndexValue

public String convertToIndexValue(QueryLiteral rawValue)
Specified by:
convertToIndexValue in interface IndexValueConverter
Parameters:
rawValue - the query literal to convert
Returns:
the string of the index representation, null if the conversion fails

convertToDuration

public Long convertToDuration(Long durationInMinutes)
Convenience method. See convertToDuration(String). Converts the duration in minutes into its duration in seconds.

Parameters:
durationInMinutes - the duration
Returns:
the duration in seconds; null if there was a problem

convertToDuration

public Long convertToDuration(String durationString)
Converts the formatted duration string into its duration in seconds.

Parameters:
durationString - the formatted duration string
Returns:
the duration in seconds; null if there was a problem

convertToIndexValue

protected String convertToIndexValue(Long durationInMinutes)
Convenience method. See convertToIndexValue(String). Converts the specified duration into the format used by the index.

Parameters:
durationInMinutes - the duration
Returns:
the index representation of the duration value in seconds

convertToIndexValue

protected String convertToIndexValue(String durationString)
Converts the specified duration into the format used by the index.

Parameters:
durationString - the formatted duration string
Returns:
the index representation of the duration value in seconds


Copyright © 2002-2012 Atlassian. All Rights Reserved.