Enum Class Duration
- All Implemented Interfaces:
Serializable
,Comparable<Duration>
,Constable
,Unit<Duration>
Represents the time duration unit. Each duration unit has an associated symbol and
the supported units are:
- ms
- sec
- min
- hr
- Day
- Week
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
Nested classes/interfaces inherited from interface oracle.communication.brm.charging.util.unit.Unit
Unit.UnitMisMatchException
-
Enum Constant Summary
Enum Constants -
Field Summary
FieldsFields inherited from interface oracle.communication.brm.charging.util.unit.Unit
MATH_CONTEXT
-
Method Summary
Modifier and TypeMethodDescriptionReturns an instance of the UnitValue with this Unit converted according to a specific ratiocreateValueFromUnitString
(String unitString, BigDecimal theValue) helper method used to choose the correct UOM and set the value.long
Deprecated.static Duration
Returns the enum constant of this class with the specified name.Returns an instance of the UnitValue with this Unit and provided quantitystatic Duration[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
Millis
-
Seconds
-
Minutes
-
Hours
-
Days
-
Weeks
-
-
Field Details
-
ALLOWABLE_DURATION
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException
- if the argument is null
-
getRatio
Deprecated.The method returns a negative value if d is smaller than this Unit. For example, if d is Millis and this Unit is in Seconds then the returned value will be 1000. If d is in Seconds and this Unit is in Millis then the returned value is -1000. Negative value is returned to avoid any expensive divisions.
- Specified by:
getRatio
in interfaceUnit<Duration>
- Parameters:
d
- Duration to find the conversion ration with.- Returns:
- long The ration between d and this Unit. TODO: this method should be made private, it is still public here to provide backward compatibility to customers who are potentially still using it.
-
valueOf
Returns an instance of the UnitValue with this Unit and provided quantity -
convert
Returns an instance of the UnitValue with this Unit converted according to a specific ratio -
createValueFromUnitString
helper method used to choose the correct UOM and set the value.- Parameters:
unitString
- the UOM for the Data valuetheValue
- the data value- Returns:
- the newly created UnitValue
from the supplied values.
-