DataSize
for correct SI and IEC prefixes.@Deprecated public class Size extends Object implements Comparable<Size>, Serializable
Modifier and Type | Method and Description |
---|---|
static Size |
bytes(long count)
Deprecated.
Constructs a new
Size object representing the specified amount of bytes. |
int |
compareTo(Size other)
Deprecated.
|
boolean |
equals(Object obj)
Deprecated.
|
static Size |
fromDataSize(DataSize dataSize)
Deprecated.
|
long |
getQuantity()
Deprecated.
Gets the quantity of the current
Size object. |
SizeUnit |
getUnit()
Deprecated.
|
static Size |
gigabytes(long count)
Deprecated.
Constructs a new
Size object representing the specified amount of gigabytes. |
int |
hashCode()
Deprecated.
|
static Size |
kilobytes(long count)
Deprecated.
Constructs a new
Size object representing the specified amount of kilobytes. |
static Size |
megabytes(long count)
Deprecated.
Constructs a new
Size object representing the specified amount of megabytes. |
static Size |
parse(String size)
Deprecated.
Constructs a
Size object from the given string representation. |
static Size |
terabytes(long count)
Deprecated.
Constructs a new
Size object representing the specified amount of terabytes. |
long |
toBytes()
Deprecated.
Returns the quantity of the current
Size object in bytes. |
DataSize |
toDataSize()
Deprecated.
|
long |
toGigabytes()
Deprecated.
Returns the quantity of the current
Size object in gigabytes. |
long |
toKilobytes()
Deprecated.
Returns the quantity of the current
Size object in kilobytes. |
long |
toMegabytes()
Deprecated.
Returns the quantity of the current
Size object in megabytes. |
String |
toString()
Deprecated.
|
long |
toTerabytes()
Deprecated.
Returns the quantity of the current
Size object in terabytes. |
public static Size bytes(long count)
Size
object representing the specified amount of bytes.count
- the amount of bytesSize
objectpublic static Size kilobytes(long count)
Size
object representing the specified amount of kilobytes.count
- the amount of kilobytesSize
objectpublic static Size megabytes(long count)
Size
object representing the specified amount of megabytes.count
- the amount of megabytesSize
objectpublic static Size gigabytes(long count)
Size
object representing the specified amount of gigabytes.count
- the amount of gigabytesSize
objectpublic static Size terabytes(long count)
Size
object representing the specified amount of terabytes.count
- the amount of terabytesSize
objectpublic static Size parse(String size)
Size
object from the given string representation.size
- the string representation to parseSize
objectIllegalArgumentException
- if the input string cannot be parsed correctlypublic long getQuantity()
Size
object.public SizeUnit getUnit()
public long toBytes()
Size
object in bytes.public long toKilobytes()
Size
object in kilobytes.public long toMegabytes()
Size
object in megabytes.public long toGigabytes()
Size
object in gigabytes.public long toTerabytes()
Size
object in terabytes.public int compareTo(Size other)
compareTo
in interface Comparable<Size>
public DataSize toDataSize()
DataSize
instanceCopyright © 2023. All rights reserved.