public final class Memory extends Object
memory
units.| Modifier and Type | Class and Description |
|---|---|
static class |
Memory.MemoryComparator
Comparator for
units. |
static class |
Memory.Unit
Units in which memory is expressed.
|
static class |
Memory.UnitComparator
Comparator for
units. |
| Modifier and Type | Method and Description |
|---|---|
long |
bytes()
The number of bytes represented by this instance.
|
static Memory |
bytes(long number)
Construct a Memory represented in bytes.
|
boolean |
equals(Object obj) |
static Memory |
gigabytes(long number)
Construct a Memory represented in gigabytes.
|
int |
hashCode() |
static Memory |
kilobytes(long number)
Construct a Memory represented in kilobytes.
|
static Memory |
megabytes(long number)
Construct a Memory represented in megabytes.
|
long |
number()
The number of
units this represents. |
static Memory |
of(long number,
Memory.Unit unit)
Construct a Memory represented in the supplied unit type.
|
static Memory |
terabytes(long number)
Construct a Memory represented in terabytes.
|
Memory |
to(Memory.Unit unit)
Convert to the supplied unit representation.
|
String |
toString() |
Memory.Unit |
unit()
The memory
Memory.Unit this is
represented in. |
public static Memory of(long number, Memory.Unit unit)
number - a long.unit - a Memory.Unit.Memory.public static Memory bytes(long number)
number - a long.Memory.public static Memory kilobytes(long number)
number - a long.Memory.public static Memory megabytes(long number)
number - a long.Memory.public static Memory gigabytes(long number)
number - a long.Memory.public static Memory terabytes(long number)
number - a long.Memory.public long number()
units this represents.public Memory.Unit unit()
Memory.Unit this is
represented in.Memory.Unit object.public long bytes()
public Memory to(Memory.Unit unit)
This may involve a loss of precision if the Unit is greater than the current representation. This will always round down to the nearest complete Unit. 2043B will be 1KB for instance.
unit - a Memory.Unit object.Memory object.Copyright © 2016 Atlassian. All rights reserved.