public enum MemoryUnit extends Enum<MemoryUnit>
Capacity
Enum Constant and Description |
---|
BYTES
MemoryUnit in bytes
|
GIGABYTES
MemoryUnit in gigabytes
|
KILOBYTES
MemoryUnit in kilobytes
|
MEGABYTES
MemoryUnit in megabytes
|
Modifier and Type | Method and Description |
---|---|
abstract String |
abbreviation() |
abstract long |
convert(long value,
MemoryUnit m) |
static MemoryUnit |
getById(int id) |
int |
getId() |
abstract long |
toBytes(long value) |
abstract long |
toGigaBytes(long value) |
abstract long |
toKiloBytes(long value) |
abstract long |
toMegaBytes(long value) |
static MemoryUnit |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static MemoryUnit[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final MemoryUnit BYTES
public static final MemoryUnit KILOBYTES
public static final MemoryUnit MEGABYTES
public static final MemoryUnit GIGABYTES
public static MemoryUnit[] values()
for (MemoryUnit c : MemoryUnit.values()) System.out.println(c);
public static MemoryUnit valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic int getId()
public static MemoryUnit getById(int id)
public abstract long convert(long value, MemoryUnit m)
public abstract long toBytes(long value)
public abstract long toKiloBytes(long value)
public abstract long toMegaBytes(long value)
public abstract long toGigaBytes(long value)
public abstract String abbreviation()
Copyright © 2023 Hazelcast, Inc.. All rights reserved.