LEFT | RIGHT |
1 /* | 1 /* |
2 Copyright 2013 Google Inc | 2 Copyright 2013 Google Inc |
3 | 3 |
4 Licensed under the Apache License, Version 2.0 (the "License"); | 4 Licensed under the Apache License, Version 2.0 (the "License"); |
5 you may not use this file except in compliance with 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 | 6 You may obtain a copy of the License at |
7 | 7 |
8 http://www.apache.org/licenses/LICENSE-2.0 | 8 http://www.apache.org/licenses/LICENSE-2.0 |
9 | 9 |
10 Unless required by applicable law or agreed to in writing, software | 10 Unless required by applicable law or agreed to in writing, software |
(...skipping 10 matching lines...) Expand all Loading... |
21 { | 21 { |
22 /// <summary> | 22 /// <summary> |
23 /// Stores and manages data objects, where the key is a string and the value
is an object. | 23 /// Stores and manages data objects, where the key is a string and the value
is an object. |
24 /// <para> | 24 /// <para> |
25 /// <c>null</c> keys are not allowed. | 25 /// <c>null</c> keys are not allowed. |
26 /// </para> | 26 /// </para> |
27 /// </summary> | 27 /// </summary> |
28 public interface IDataStore | 28 public interface IDataStore |
29 { | 29 { |
30 /// <summary>Stores the given value for the given key (replacing any exi
sting value).</summary> | 30 /// <summary>Stores the given value for the given key (replacing any exi
sting value).</summary> |
| 31 /// <typeparam name="T">The type to store in the data store</typeparam> |
| 32 /// <param name="key">The key</param> |
| 33 /// <param name="value">The value to store in the data store</param> |
31 Task Store<T>(string key, T value); | 34 Task Store<T>(string key, T value); |
32 | 35 |
33 /// <summary> | 36 /// <summary> |
34 /// Deletes the given key. The type is provided here as well because the
"real" saved key should contain· | 37 /// Deletes the given key. The type is provided here as well because the
"real" saved key should contain· |
35 /// type information as well, so the data store will be able to store th
e same key for different types. | 38 /// type information as well, so the data store will be able to store th
e same key for different types. |
36 /// </summary> | 39 /// </summary> |
| 40 /// <param name="key">The key to delete from the data store</param> |
| 41 /// <param name="t">The type of the stored value</param> |
37 Task Delete(string key, Type t); | 42 Task Delete(string key, Type t); |
38 | 43 |
39 /// <summary>Returns the stored value for the given key or <c>null</c> i
f not found.</summary> | 44 /// <summary>Returns the stored value for the given key or <c>null</c> i
f not found.</summary> |
| 45 /// <typeparam name="T">The type to retrieve</typeparam> |
| 46 /// <param name="key">The key to retrieve from the data store</param> |
| 47 /// <returns>The stored object</returns> |
40 Task<T> Get<T>(string key); | 48 Task<T> Get<T>(string key); |
41 | 49 |
42 /// <summary>Clear all values in the data store.</summary> | 50 /// <summary>Clears all values in the data store.</summary> |
43 Task Clear(); | 51 Task Clear(); |
44 } | 52 } |
45 } | 53 } |
LEFT | RIGHT |