Simon Hunt
Committed by Gerrit Code Review

GUI -- Made OOTB formatters and comparators final classes.

Change-Id: I0ea59bf92d97b6d104b7d3770fb5f2e93308bbdc
......@@ -23,7 +23,10 @@ import org.onosproject.ui.table.CellFormatter;
/**
* Formats an application identifier as "(app-id) : (app-name)".
*/
public class AppIdFormatter extends AbstractCellFormatter {
public final class AppIdFormatter extends AbstractCellFormatter {
// non-instantiable
private AppIdFormatter() { }
@Override
protected String nonNullFormat(Object value) {
......
......@@ -23,7 +23,10 @@ import org.onosproject.ui.table.CellFormatter;
/**
* Formats a connect point as "(element-id)/(port)".
*/
public class ConnectPointFormatter extends AbstractCellFormatter {
public final class ConnectPointFormatter extends AbstractCellFormatter {
// non-instantiable
private ConnectPointFormatter() { }
@Override
protected String nonNullFormat(Object value) {
......
......@@ -25,7 +25,10 @@ import org.onosproject.ui.table.CellComparator;
* compares the resulting strings. Note that null values are acceptable and
* are considered "smaller" than any non-null value.
*/
public class DefaultCellComparator extends AbstractCellComparator {
public final class DefaultCellComparator extends AbstractCellComparator {
// non-instantiable
private DefaultCellComparator() { }
@Override
protected int nonNullCompare(Object o1, Object o2) {
......
......@@ -22,7 +22,10 @@ import org.onosproject.ui.table.CellFormatter;
/**
* A default cell formatter. Uses the object's toString() method.
*/
public class DefaultCellFormatter extends AbstractCellFormatter {
public final class DefaultCellFormatter extends AbstractCellFormatter {
// non-instantiable
private DefaultCellFormatter() { }
@Override
public String nonNullFormat(Object value) {
......
......@@ -23,7 +23,10 @@ import static org.apache.commons.lang.WordUtils.capitalizeFully;
/**
* Formats enum types to be readable strings.
*/
public class EnumFormatter extends AbstractCellFormatter {
public final class EnumFormatter extends AbstractCellFormatter {
// non-instantiable
private EnumFormatter() { }
@Override
protected String nonNullFormat(Object value) {
......
......@@ -22,7 +22,10 @@ import org.onosproject.ui.table.CellFormatter;
/**
* Formats integer values as hex strings with a "0x" prefix.
*/
public class HexFormatter extends AbstractCellFormatter {
public final class HexFormatter extends AbstractCellFormatter {
// non-instantiable
private HexFormatter() { }
@Override
protected String nonNullFormat(Object value) {
......
......@@ -23,7 +23,10 @@ import org.onosproject.ui.table.CellFormatter;
/**
* Formats a host location as "(device-id)/(port)".
*/
public class HostLocationFormatter extends AbstractCellFormatter {
public final class HostLocationFormatter extends AbstractCellFormatter {
// non-instantiable
private HostLocationFormatter() { }
@Override
protected String nonNullFormat(Object value) {
......
......@@ -24,7 +24,10 @@ import org.onosproject.ui.table.CellComparator;
* Note that null values are acceptable and are considered "smaller" than
* any non-null value.
*/
public class IntComparator extends AbstractCellComparator {
public final class IntComparator extends AbstractCellComparator {
// non-instantiable
private IntComparator() { }
@Override
protected int nonNullCompare(Object o1, Object o2) {
......
......@@ -24,7 +24,10 @@ import org.onosproject.ui.table.CellComparator;
* Note that null values are acceptable and are considered "smaller" than
* any non-null value.
*/
public class LongComparator extends AbstractCellComparator {
public final class LongComparator extends AbstractCellComparator {
// non-instantiable
private LongComparator() { }
@Override
protected int nonNullCompare(Object o1, Object o2) {
......
......@@ -25,10 +25,13 @@ import org.onosproject.ui.table.CellFormatter;
/**
* Formats time values using {@link DateTimeFormatter}.
*/
public class TimeFormatter extends AbstractCellFormatter {
public final class TimeFormatter extends AbstractCellFormatter {
private static final DateTimeFormatter DTF = DateTimeFormat.longTime();
// non-instantiable
private TimeFormatter() { }
@Override
protected String nonNullFormat(Object value) {
return DTF.print((DateTime) value);
......