blob: 477568745c735c4a3064cc02615cdefbd58b7034 [file] [log] [blame]
Bri Prebilic Cole468bc1d2015-02-12 12:11:13 -08001/*
2 * Copyright 2015 Open Networking Laboratory
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Simon Hunt44aa2f82015-04-30 15:01:35 -070017package org.onosproject.ui.table;
Bri Prebilic Cole468bc1d2015-02-12 12:11:13 -080018
19
20import com.fasterxml.jackson.databind.node.ObjectNode;
21
22/**
23 * Defines a table row abstraction to support sortable tables on the GUI.
24 */
25public interface TableRow {
Simon Hunt44aa2f82015-04-30 15:01:35 -070026
27 // TODO: Define TableCell interface and return that, rather than String
28 // The hope is that this will allow us to write a generic mechanism for
29 // selecting a comparator based on the cell type for the column, to be
30 // used for sorting the table rows.
Bri Prebilic Cole468bc1d2015-02-12 12:11:13 -080031 /**
32 * Returns the value of the cell for the given column ID.
33 *
34 * @param key the column ID
35 * @return the cell value
36 */
37 String get(String key);
38
39 /**
40 * Returns this table row in the form of a JSON object.
41 *
42 * @return the JSON node
43 */
44 ObjectNode toJsonNode();
45}