Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1603)

Unified Diff: Src/GoogleApis/Apis/Util/Store/IDataStore.cs

Issue 13412046: Reimplement OAuth2 library - Step 1 (Closed) Base URL: https://google-api-dotnet-client.googlecode.com/hg/
Patch Set: minor Created 10 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Src/GoogleApis/Apis/Util/Store/IDataStore.cs
===================================================================
new file mode 100644
--- /dev/null
b/Src/GoogleApis/Apis/Util/Store/IDataStore.cs
@@ -0,0 1,53 @@
/*
Copyright 2013 Google Inc
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
using System;
using System.Threading.Tasks;
namespace Google.Apis.Util.Store
{
/// <summary>
/// Stores and manages data objects, where the key is a string and the value is an object.
/// <para>
/// <c>null</c> keys are not allowed.
/// </para>
/// </summary>
public interface IDataStore
{
/// <summary>Stores the given value for the given key (replacing any existing value).</summary>
/// <typeparam name="T">The type to store in the data store</typeparam>
/// <param name="key">The key</param>
/// <param name="value">The value to store in the data store</param>
Task Store<T>(string key, T value);
/// <summary>
/// Deletes the given key. The type is provided here as well because the "real" saved key should contain
/// type information as well, so the data store will be able to store the same key for different types.
/// </summary>
/// <param name="key">The key to delete from the data store</param>
/// <param name="t">The type of the stored value</param>
Task Delete(string key, Type t);
/// <summary>Returns the stored value for the given key or <c>null</c> if not found.</summary>
/// <typeparam name="T">The type to retrieve</typeparam>
/// <param name="key">The key to retrieve from the data store</param>
/// <returns>The stored object</returns>
Task<T> Get<T>(string key);
/// <summary>Clears all values in the data store.</summary>
Task Clear();
}
}

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b