Madan Jampani | 08822c4 | 2014-11-04 17:17:46 -0800 | [diff] [blame^] | 1 | package org.onlab.onos.store.service; |
| 2 | |
| 3 | import org.onlab.onos.store.service.impl.VersionedValue; |
| 4 | |
| 5 | /** |
| 6 | * Database read result. |
| 7 | */ |
| 8 | public class ReadResult { |
| 9 | |
| 10 | private final String tableName; |
| 11 | private final String key; |
| 12 | private final VersionedValue value; |
| 13 | |
| 14 | public ReadResult(String tableName, String key, VersionedValue value) { |
| 15 | this.tableName = tableName; |
| 16 | this.key = key; |
| 17 | this.value = value; |
| 18 | } |
| 19 | |
| 20 | /** |
| 21 | * Database table name. |
| 22 | * @return |
| 23 | */ |
| 24 | public String tableName() { |
| 25 | return tableName; |
| 26 | } |
| 27 | |
| 28 | /** |
| 29 | * Database table key. |
| 30 | * @return key. |
| 31 | */ |
| 32 | public String key() { |
| 33 | return key; |
| 34 | } |
| 35 | |
| 36 | /** |
| 37 | * value associated with the key. |
| 38 | * @return non-null value if the table contains one, null otherwise. |
| 39 | */ |
| 40 | public VersionedValue value() { |
| 41 | return value; |
| 42 | } |
| 43 | } |