blob: 33b57d2447d169c5fa9089555f2650e0d9476b9f [file] [log] [blame]
Madan Jampani08822c42014-11-04 17:17:46 -08001package org.onlab.onos.store.service;
2
Madan Jampani08822c42014-11-04 17:17:46 -08003
4/**
5 * Database read result.
6 */
7public class ReadResult {
8
9 private final String tableName;
10 private final String key;
11 private final VersionedValue value;
12
13 public ReadResult(String tableName, String key, VersionedValue value) {
14 this.tableName = tableName;
15 this.key = key;
16 this.value = value;
17 }
18
19 /**
Madan Jampani9b19a822014-11-04 21:37:13 -080020 * Returns database table name.
21 * @return table name.
Madan Jampani08822c42014-11-04 17:17:46 -080022 */
23 public String tableName() {
24 return tableName;
25 }
26
27 /**
Madan Jampani9b19a822014-11-04 21:37:13 -080028 * Returns database table key.
Madan Jampani08822c42014-11-04 17:17:46 -080029 * @return key.
30 */
31 public String key() {
32 return key;
33 }
34
35 /**
Madan Jampani9b19a822014-11-04 21:37:13 -080036 * Returns value associated with the key.
Madan Jampani08822c42014-11-04 17:17:46 -080037 * @return non-null value if the table contains one, null otherwise.
38 */
39 public VersionedValue value() {
40 return value;
41 }
42}