Package org.onosproject.ui.table.cell
Class TimeFormatter
- java.lang.Object
-
- org.onosproject.ui.table.cell.AbstractCellFormatter
-
- org.onosproject.ui.table.cell.TimeFormatter
-
- All Implemented Interfaces:
CellFormatter
public final class TimeFormatter extends AbstractCellFormatter
Formats time values usingDateTimeFormatter
.
-
-
Field Summary
-
Fields inherited from class org.onosproject.ui.table.cell.AbstractCellFormatter
EMPTY, OX, QUERY, SLASH, SPACE, UNDERSCORE
-
-
Constructor Summary
Constructors Constructor Description TimeFormatter()
Constructs a time formatter that uses the default locale and timezone.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.String
nonNullFormat(java.lang.Object value)
Formats the specified value into a string appropriate for displaying in a table cell.TimeFormatter
withLocale(java.util.Locale locale)
Sets the locale to use for formatting the time.TimeFormatter
withZone(java.time.ZoneId zone)
Sets the time zone to use for formatting the time.-
Methods inherited from class org.onosproject.ui.table.cell.AbstractCellFormatter
format
-
-
-
-
Method Detail
-
withLocale
public TimeFormatter withLocale(java.util.Locale locale)
Sets the locale to use for formatting the time.- Parameters:
locale
- locale to use for formatting- Returns:
- self, for chaining
-
withZone
public TimeFormatter withZone(java.time.ZoneId zone)
Sets the time zone to use for formatting the time.- Parameters:
zone
- time zone to use- Returns:
- self, for chaining
-
nonNullFormat
protected java.lang.String nonNullFormat(java.lang.Object value)
Description copied from class:AbstractCellFormatter
Formats the specified value into a string appropriate for displaying in a table cell. Note that value is guaranteed to be non-null.- Specified by:
nonNullFormat
in classAbstractCellFormatter
- Parameters:
value
- the value- Returns:
- the formatted string
-
-