Enum Class Data
- All Implemented Interfaces:
Serializable
,Comparable<Data>
,Constable
,Unit<Data>
Represents a Data volume unit with supported units in:
- Bytes
- KiloBytes = KibiBytes = 1024 Bytes
- MegaBytes = MebiBytes = 1024 * 1024 Bytes
- GigaBytes = GibiBytes = 1024 * 1024 * 1024 Bytes
- TeraBytes = TebiBytes = 1024 * 1024 * 1024 * 1024 Bytes
- Version:
- 1.0
- Author:
- ashsriva
-
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
FieldsModifier and TypeFieldDescriptionFields 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 Data
Returns the enum constant of this class with the specified name.Returns an instance of the UnitValue with this Unit and provided quantitystatic Data[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
Bytes
-
KibiBytes
-
MebiBytes
-
GibiBytes
-
TebiBytes
-
KiloBytes
-
MegaBytes
-
GigaBytes
-
TeraBytes
-
-
Field Details
-
METRIC_PREFIX_SET
-
BINARY_PREFIX_SET
-
-
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 KibiBytes and this Unit is in MebiBytes then the returned value will be 1024. If d is in MebiBytes and this Unit is in KibiBytes then the returned value is -1024. Negative value is returned to avoid any expensive divisions.
-
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:
- returns the newly created UnitValue from the supplied values.
-