public enum SizeUnit extends Enum<SizeUnit>
Enum Constant and Description |
---|
BYTES |
GIGA_BYTES |
KILO_BYTES |
MEGA_BYTES |
Modifier and Type | Method and Description |
---|---|
long |
toBytes(long value) |
long |
toGigaBytes(long value) |
long |
toKiloBytes(long value) |
long |
toMegaBytes(long value) |
static SizeUnit |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static SizeUnit[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final SizeUnit BYTES
public static final SizeUnit KILO_BYTES
public static final SizeUnit MEGA_BYTES
public static final SizeUnit GIGA_BYTES
public static SizeUnit[] values()
for (SizeUnit c : SizeUnit.values()) System.out.println(c);
public static SizeUnit 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 long toBytes(long value)
public long toKiloBytes(long value)
public long toMegaBytes(long value)
public long toGigaBytes(long value)
Copyright © 2017–2022 Apache Software Foundation. All rights reserved.