Package de.xima.fc.common.bean_models
Enum ETimeUnit
- java.lang.Object
-
- java.lang.Enum<ETimeUnit>
-
- de.xima.fc.common.bean_models.ETimeUnit
-
- All Implemented Interfaces:
INamedUiElement
,Serializable
,Comparable<ETimeUnit>
public enum ETimeUnit extends Enum<ETimeUnit> implements INamedUiElement
Enumeration for the unit of the read and connect timeout of the HTTP request action.- Since:
- 8.1.0
- Author:
- XIMA MEDIA GmbH
-
-
Enum Constant Summary
Enum Constants Enum Constant Description DAYS
86400 seconds.HOURS
3600 seconds.MICROSECONDS
1/1000000th of a second.MILLISECONDS
1/1000th of a second.MINUTES
60 seconds.NANOSECONDS
1/1000000000th of a second.SECONDS
One second.WEEKS
604800 seconds.
-
Field Summary
-
Fields inherited from interface de.xima.fc.interfaces.INamedUiElement
ATTR_DISPLAY_NAME
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description BigDecimal
convertToBigDecimal(long duration, ETimeUnit targetUnit, MathContext mathContext)
Converts the given duration to the given unit.BigInteger
convertToBigInt(long duration, ETimeUnit targetUnit)
Converts the given duration to the given unit.double
convertToDouble(long duration, ETimeUnit targetUnit)
Converts the given duration to the given unit.long
convertToLong(long duration, ETimeUnit targetUnit)
Converts the given duration to the given unit.String
getDisplayName(Locale locale)
The display name of this element in the given locale.org.apache.commons.math3.fraction.Fraction
scaleFactor()
Gets the scale factor of this unit, i.e.static ETimeUnit
valueOf(String name)
Returns the enum constant of this type with the specified name.static ETimeUnit[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
NANOSECONDS
public static final ETimeUnit NANOSECONDS
1/1000000000th of a second.
-
MICROSECONDS
public static final ETimeUnit MICROSECONDS
1/1000000th of a second.
-
MILLISECONDS
public static final ETimeUnit MILLISECONDS
1/1000th of a second.
-
SECONDS
public static final ETimeUnit SECONDS
One second.
-
MINUTES
public static final ETimeUnit MINUTES
60 seconds.
-
HOURS
public static final ETimeUnit HOURS
3600 seconds.
-
DAYS
public static final ETimeUnit DAYS
86400 seconds.
-
WEEKS
public static final ETimeUnit WEEKS
604800 seconds.
-
-
Method Detail
-
values
public static ETimeUnit[] 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 (ETimeUnit c : ETimeUnit.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ETimeUnit 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 nameNullPointerException
- if the argument is null
-
convertToBigDecimal
public BigDecimal convertToBigDecimal(long duration, ETimeUnit targetUnit, MathContext mathContext)
Converts the given duration to the given unit.- Parameters:
duration
- The duration to convert.targetUnit
- The unit to convert to.mathContext
- The math context to use for the division.- Returns:
- The given duration expressed in the target unit.
-
convertToBigInt
public BigInteger convertToBigInt(long duration, ETimeUnit targetUnit)
Converts the given duration to the given unit.- Parameters:
duration
- The duration to convert.targetUnit
- The unit to convert to.- Returns:
- The given duration expressed in the target unit.
-
convertToDouble
public double convertToDouble(long duration, ETimeUnit targetUnit)
Converts the given duration to the given unit.- Parameters:
duration
- The duration to convert.targetUnit
- The unit to convert to.- Returns:
- The given duration expressed in the target unit.
-
convertToLong
public long convertToLong(long duration, ETimeUnit targetUnit)
Converts the given duration to the given unit.- Parameters:
duration
- The duration to convert.targetUnit
- The unit to convert to.- Returns:
- The given duration expressed in the target unit.
-
getDisplayName
public String getDisplayName(Locale locale)
Description copied from interface:INamedUiElement
The display name of this element in the given locale.- Specified by:
getDisplayName
in interfaceINamedUiElement
- Parameters:
locale
- The locale to get the display name for.- Returns:
- The display name of this element in the given locale.
-
scaleFactor
public org.apache.commons.math3.fraction.Fraction scaleFactor()
Gets the scale factor of this unit, i.e. the number of seconds in this unit.- Returns:
- The scale factor of this unit.
-
-