Class JqlTimetrackingDurationSupportImpl

java.lang.Object
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 Details

    • JqlTimetrackingDurationSupportImpl

      public JqlTimetrackingDurationSupportImpl(JiraDurationUtils durationUtils)
  • Method Details

    • 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