Bri Prebilic Cole | 468bc1d | 2015-02-12 12:11:13 -0800 | [diff] [blame] | 1 | /* |
| 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 Hunt | 44aa2f8 | 2015-04-30 15:01:35 -0700 | [diff] [blame] | 17 | package org.onosproject.ui.table; |
Bri Prebilic Cole | 468bc1d | 2015-02-12 12:11:13 -0800 | [diff] [blame] | 18 | |
| 19 | |
| 20 | import com.fasterxml.jackson.databind.node.ObjectNode; |
| 21 | |
| 22 | /** |
| 23 | * Defines a table row abstraction to support sortable tables on the GUI. |
| 24 | */ |
| 25 | public interface TableRow { |
Simon Hunt | 44aa2f8 | 2015-04-30 15:01:35 -0700 | [diff] [blame] | 26 | |
| 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 Cole | 468bc1d | 2015-02-12 12:11:13 -0800 | [diff] [blame] | 31 | /** |
| 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 | } |