public static enum StringUtils.TraditionalBinaryPrefix extends Enum<StringUtils.TraditionalBinaryPrefix>
Modifier and Type | Field and Description |
---|---|
long |
bitMask |
int |
bitShift |
char |
symbol |
long |
value |
Modifier and Type | Method and Description |
---|---|
static String |
long2String(long n,
String unit,
int decimalPlaces)
Convert a long integer to a string with traditional binary prefix.
|
static long |
string2long(String s)
Convert a string to long.
|
static StringUtils.TraditionalBinaryPrefix |
valueOf(char symbol) |
static StringUtils.TraditionalBinaryPrefix |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static StringUtils.TraditionalBinaryPrefix[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final StringUtils.TraditionalBinaryPrefix KILO
public static final StringUtils.TraditionalBinaryPrefix MEGA
public static final StringUtils.TraditionalBinaryPrefix GIGA
public static final StringUtils.TraditionalBinaryPrefix TERA
public static final StringUtils.TraditionalBinaryPrefix PETA
public static final StringUtils.TraditionalBinaryPrefix EXA
public final long value
public final char symbol
public final int bitShift
public final long bitMask
public static StringUtils.TraditionalBinaryPrefix[] values()
for (StringUtils.TraditionalBinaryPrefix c : StringUtils.TraditionalBinaryPrefix.values()) System.out.println(c);
public static StringUtils.TraditionalBinaryPrefix 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 static StringUtils.TraditionalBinaryPrefix valueOf(char symbol)
public static long string2long(String s)
s
- input stringpublic static String long2String(long n, String unit, int decimalPlaces)
n
- the value to be convertedunit
- The unit, e.g. "B" for bytes.decimalPlaces
- The number of decimal places.Copyright © 2017 Apache Software Foundation. All Rights Reserved.