Package org.onosproject.ui.table.cell
Class AbstractCellFormatter
- java.lang.Object
-
- org.onosproject.ui.table.cell.AbstractCellFormatter
-
- All Implemented Interfaces:
CellFormatter
- Direct Known Subclasses:
AppIdFormatter
,ConnectPointFormatter
,DefaultCellFormatter
,EnumFormatter
,HexFormatter
,HexLongFormatter
,HostLocationFormatter
,NumberFormatter
,TimeFormatter
public abstract class AbstractCellFormatter extends java.lang.Object implements CellFormatter
Base implementation of aCellFormatter
. This class takes care of dealing with null inputs; subclasses should implement their format method knowing that the input is guaranteed to be non-null.
-
-
Constructor Summary
Constructors Constructor Description AbstractCellFormatter()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.String
format(java.lang.Object value)
Formats the specified value into a string appropriate for displaying in a table cell.protected abstract java.lang.String
nonNullFormat(java.lang.Object value)
Formats the specified value into a string appropriate for displaying in a table cell.
-
-
-
Field Detail
-
EMPTY
protected static final java.lang.String EMPTY
- See Also:
- Constant Field Values
-
SLASH
protected static final java.lang.String SLASH
- See Also:
- Constant Field Values
-
QUERY
protected static final java.lang.String QUERY
- See Also:
- Constant Field Values
-
UNDERSCORE
protected static final java.lang.String UNDERSCORE
- See Also:
- Constant Field Values
-
SPACE
protected static final java.lang.String SPACE
- See Also:
- Constant Field Values
-
OX
protected static final java.lang.String OX
- See Also:
- Constant Field Values
-
-
Method Detail
-
format
public java.lang.String format(java.lang.Object value)
Description copied from interface:CellFormatter
Formats the specified value into a string appropriate for displaying in a table cell. Note that null values are acceptable, and will result in the empty string.- Specified by:
format
in interfaceCellFormatter
- Parameters:
value
- the value- Returns:
- the formatted string
-
nonNullFormat
protected abstract java.lang.String nonNullFormat(java.lang.Object value)
Formats the specified value into a string appropriate for displaying in a table cell. Note that value is guaranteed to be non-null.- Parameters:
value
- the value- Returns:
- the formatted string
-
-