| Modifier and Type | Method and Description |
|---|---|
DataSize.Unit |
DataSize.getUnit() |
static DataSize.Unit |
DataSize.Unit.valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static DataSize.Unit[] |
DataSize.Unit.values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
| Modifier and Type | Method and Description |
|---|---|
DataSize |
DataSize.convertTo(DataSize.Unit unit)
Deprecated.
Use
DataSize.to(Unit) instead. No conversion occurs when calling this method, only the unit
used for the default string representation is changed. This has no effect on the unit used during JSON serialization |
double |
DataSize.getValue(DataSize.Unit unit)
Deprecated.
Use
DataSize.toBytes() instead to avoid floating point precision semantics |
static DataSize |
DataSize.of(long size,
DataSize.Unit unit)
Creates a
DataSize instance with the provided quantity of the provided DataSize.Unit. |
long |
DataSize.roundTo(DataSize.Unit unit)
Deprecated.
Use
DataSize.toBytes() instead. This method uses floating point semantics to compute the
rounded value which can yield to unexpected loss of precision beyond the intended rounding |
static DataSize |
DataSize.succinctDataSize(double size,
DataSize.Unit unit)
Deprecated.
use
DataSize.succinctBytes(long) instead, double values are imprecise |
DataSize |
DataSize.to(DataSize.Unit unit) |
| Constructor and Description |
|---|
DataSize(double size,
DataSize.Unit unit)
Deprecated.
Use
DataSize.ofBytes(long) instead. The imprecise nature of using doubles for DataSize is deprecated for removal |
Copyright © 2016–2022 Airlift. All rights reserved.