com.atlassian.jira.util
Class JiraDurationUtils.HoursDurationFormatter
java.lang.Object
com.atlassian.jira.util.JiraDurationUtils.HoursDurationFormatter
- All Implemented Interfaces:
- JiraDurationUtils.DurationFormatter
- Enclosing class:
- JiraDurationUtils
public static class JiraDurationUtils.HoursDurationFormatter
- extends Object
- implements JiraDurationUtils.DurationFormatter
This formatter formats time duration to hours only. The resulting string returned is a real number representing
the number of hours. This value is then formatted according to system or user's locale.
Method Summary |
String |
format(Long duration)
Converts the given time duration into hours and formats it based on the system locale. |
String |
format(Long duration,
Locale locale)
Converts the given time duration into hours and formats it based on the given user's locale. |
String |
getI18nKey()
|
String |
shortFormat(Long duration)
Formats a given time duration with given locale in the most compact way possible. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
KEY_FORMAT_HOURS
public static final String KEY_FORMAT_HOURS
- See Also:
- Constant Field Values
JiraDurationUtils.HoursDurationFormatter
public JiraDurationUtils.HoursDurationFormatter(I18nBean i18nBean)
getI18nKey
public String getI18nKey()
- Specified by:
getI18nKey
in interface JiraDurationUtils.DurationFormatter
format
public String format(Long duration)
- Converts the given time duration into hours and formats it based on the system locale. If the duration given
is a negative number, returns an empty string.
- Specified by:
format
in interface JiraDurationUtils.DurationFormatter
- Parameters:
duration
- time duration to format
- Returns:
- formatted time duration or an empty string
format
public String format(Long duration,
Locale locale)
- Converts the given time duration into hours and formats it based on the given user's locale. If the duration
given is a negative number, returns an empty string.
- Specified by:
format
in interface JiraDurationUtils.DurationFormatter
- Parameters:
duration
- time duration to formatlocale
- user's locale
- Returns:
- formatted time duration or an empty string
shortFormat
public String shortFormat(Long duration)
- Description copied from interface:
JiraDurationUtils.DurationFormatter
- Formats a given time duration with given locale in the most compact way possible.
- Specified by:
shortFormat
in interface JiraDurationUtils.DurationFormatter
- Parameters:
duration
- time duration to format
- Returns:
- formatted time duration
Copyright © 2002-2008 Atlassian. All Rights Reserved.