public class UIUtils
extends Object
Constructor and Description |
---|
UIUtils() |
Modifier and Type | Method and Description |
---|---|
static double |
convertToTimeUnit(long milliseconds,
java.util.concurrent.TimeUnit unit)
Convert
milliseconds to the specified unit . |
static String |
createOutputOperationFailureForUI(String failure) |
static scala.collection.Seq<scala.xml.Node> |
failureReasonCell(String failureReason,
int rowspan,
boolean includeFirstLineInExpandDetails) |
static String |
formatBatchTime(long batchTime,
long batchInterval,
boolean showYYYYMMSS,
java.util.TimeZone timezone)
If
batchInterval is less than 1 second, format batchTime with milliseconds. |
static scala.Tuple2<Object,java.util.concurrent.TimeUnit> |
normalizeDuration(long milliseconds)
Find the best
TimeUnit for converting milliseconds to a friendly string. |
static String |
shortTimeUnitString(java.util.concurrent.TimeUnit unit)
Return the short string for a
TimeUnit . |
public static String shortTimeUnitString(java.util.concurrent.TimeUnit unit)
TimeUnit
.unit
- (undocumented)public static scala.Tuple2<Object,java.util.concurrent.TimeUnit> normalizeDuration(long milliseconds)
TimeUnit
for converting milliseconds to a friendly string. Return the value
after converting, also with its TimeUnit.milliseconds
- (undocumented)public static double convertToTimeUnit(long milliseconds, java.util.concurrent.TimeUnit unit)
milliseconds
to the specified unit
. We cannot use TimeUnit.convert
because it
will discard the fractional part.milliseconds
- (undocumented)unit
- (undocumented)public static String formatBatchTime(long batchTime, long batchInterval, boolean showYYYYMMSS, java.util.TimeZone timezone)
batchInterval
is less than 1 second, format batchTime
with milliseconds. Otherwise,
format batchTime
without milliseconds.
batchTime
- the batch time to be formattedbatchInterval
- the batch intervalshowYYYYMMSS
- if showing the yyyy/MM/dd
part. If it's false, the return value wll be
only HH:mm:ss
or HH:mm:ss.SSS
depending on batchInterval
timezone
- only for testpublic static String createOutputOperationFailureForUI(String failure)
public static scala.collection.Seq<scala.xml.Node> failureReasonCell(String failureReason, int rowspan, boolean includeFirstLineInExpandDetails)