public class FormatUtils extends Object
Modifier and Type | Field and Description |
---|---|
private static double |
BYTES_IN_GIGABYTE |
private static double |
BYTES_IN_KILOBYTE |
private static double |
BYTES_IN_MEGABYTE |
private static double |
BYTES_IN_TERABYTE |
private static String |
DAYS |
private static String |
HOURS |
private static String |
MILLIS |
private static String |
MINS |
private static String |
NANOS |
private static String |
SECS |
static Pattern |
TIME_DURATION_PATTERN |
static String |
TIME_DURATION_REGEX |
private static String |
UNION |
private static String |
VALID_TIME_UNITS |
private static String |
WEEKS |
Constructor and Description |
---|
FormatUtils() |
Modifier and Type | Method and Description |
---|---|
static String |
formatCount(long count)
Formats the specified count by adding commas.
|
static String |
formatDataSize(double dataSize)
Formats the specified data size in human readable format.
|
static String |
formatHoursMinutesSeconds(long sourceDuration,
TimeUnit sourceUnit)
Formats the specified duration in 'HH:mm:ss.SSS' format.
|
static String |
formatMinutesSeconds(long sourceDuration,
TimeUnit sourceUnit)
Formats the specified duration in 'mm:ss.SSS' format.
|
static String |
formatUtilization(double utilization) |
static long |
getTimeDuration(String value,
TimeUnit desiredUnit) |
private static String |
join(String delimiter,
String... values) |
private static String |
pad(int val) |
private static final String UNION
private static final double BYTES_IN_KILOBYTE
private static final double BYTES_IN_MEGABYTE
private static final double BYTES_IN_GIGABYTE
private static final double BYTES_IN_TERABYTE
private static final String NANOS
private static final String MILLIS
private static final String SECS
private static final String MINS
private static final String HOURS
private static final String DAYS
private static final String WEEKS
private static final String VALID_TIME_UNITS
public static final String TIME_DURATION_REGEX
public static final Pattern TIME_DURATION_PATTERN
public static String formatCount(long count)
count
- the value to add commas topublic static String formatMinutesSeconds(long sourceDuration, TimeUnit sourceUnit)
sourceDuration
- the duration to formatsourceUnit
- the unit to interpret the durationpublic static String formatHoursMinutesSeconds(long sourceDuration, TimeUnit sourceUnit)
sourceDuration
- the duration to formatsourceUnit
- the unit to interpret the durationprivate static String pad(int val)
public static String formatDataSize(double dataSize)
dataSize
- Data size in bytespublic static String formatUtilization(double utilization)
Copyright © 2016 Apache NiFi Project. All rights reserved.