@groovy.transform.CompileStatic @groovy.transform.EqualsAndHashCode(includes = 'size', includeFields = true) class MemoryUnit extends java.lang.Object
Represent a memory unit
| Modifiers | Name | Description |
|---|---|---|
static java.util.List |
UNITS |
|
static MemoryUnit |
ZERO |
| Constructor and description |
|---|
MemoryUnit
(long value)Create a memory unit instance |
MemoryUnit
(java.lang.String str)Create a memory unit instance with the given semantic string |
| Type Params | Return Type | Name and description |
|---|---|---|
|
boolean |
asBoolean() |
|
int |
compareTo(MemoryUnit that) |
|
static int |
compareTo(MemoryUnit left, java.lang.Object right) |
|
MemoryUnit |
div(java.lang.Number value) |
|
long |
getBytes() |
|
long |
getGiga() |
|
long |
getKilo() |
|
long |
getMega() |
|
MemoryUnit |
minus(MemoryUnit value) |
|
MemoryUnit |
multiply(java.lang.Number value) |
|
static MemoryUnit |
of(java.lang.String value) |
|
static MemoryUnit |
of(long value) |
|
MemoryUnit |
plus(MemoryUnit value) |
|
long |
toBytes() |
|
long |
toGiga() |
|
long |
toKilo() |
|
long |
toMega() |
|
java.lang.String |
toString() |
|
long |
toUnit(java.lang.String unit)Function to parse/convert given memory unit |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Create a memory unit instance
value - The number of bytes it representCreate a memory unit instance with the given semantic string
str - A string using the following of of the following units: B, KB, MB, GB, TB, PB, EB, ZBFunction to parse/convert given memory unit
unit - String expressing memory unit in bytes, e.g. KB, MB, GB