com.atlassian.core.util
Enum DateUtils.Duration
java.lang.Object
java.lang.Enum<DateUtils.Duration>
com.atlassian.core.util.DateUtils.Duration
- All Implemented Interfaces:
- Serializable, Comparable<DateUtils.Duration>
- Enclosing class:
- DateUtils
public static enum DateUtils.Duration
- extends Enum<DateUtils.Duration>
SECOND
public static final DateUtils.Duration SECOND
MINUTE
public static final DateUtils.Duration MINUTE
HOUR
public static final DateUtils.Duration HOUR
DAY
public static final DateUtils.Duration DAY
WEEK
public static final DateUtils.Duration WEEK
MONTH
public static final DateUtils.Duration MONTH
YEAR
public static final DateUtils.Duration YEAR
values
public static DateUtils.Duration[] values()
- Returns an array containing the constants of this enum type, in
the order they are declared. This method may be used to iterate
over the constants as follows:
for (DateUtils.Duration c : DateUtils.Duration.values())
System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in
the order they are declared
valueOf
public static DateUtils.Duration valueOf(String name)
- Returns the enum constant of this type with the specified name.
The string must match exactly an identifier used to declare an
enum constant in this type. (Extraneous whitespace characters are
not permitted.)
- Parameters:
name - the name of the enum constant to be returned.
- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException - if this enum type has no constant
with the specified name
NullPointerException - if the argument is null
getSeconds
public long getSeconds()
getMilliseconds
public long getMilliseconds()
getModifiedSeconds
public long getModifiedSeconds(long secondsPerDay,
long secondsPerWeek)
- Sometimes customers configure the meaning of "day" or "week" to mean something like "1 day = 8 hours".
- Parameters:
secondsPerDay - how many seconds are in a "day"secondsPerWeek - how many seconds are in a "week" (based on number of days per week and hours per day)
- Returns:
- number of seconds in the duration, taking into account the modified definition of "day" and "week"
Copyright © 2015 Atlassian. All rights reserved.