diff options
author | Dennis Kobert <d-kobert@web.de> | 2019-05-19 16:03:38 +0200 |
---|---|---|
committer | Dennis Kobert <d-kobert@web.de> | 2019-05-19 16:03:38 +0200 |
commit | f89f308c525e9deebc6d2cf6416e27dfe1a299dc (patch) | |
tree | 7097ef871ead0245efda696198443eab8e443d3a /FireBase/Offline/OfflineEntry.cs | |
parent | f3983341be939235c1a6cd522b3bb5cc318a6d1a (diff) |
Cleanup DiscoBot Project
Diffstat (limited to 'FireBase/Offline/OfflineEntry.cs')
-rw-r--r-- | FireBase/Offline/OfflineEntry.cs | 60 |
1 files changed, 18 insertions, 42 deletions
diff --git a/FireBase/Offline/OfflineEntry.cs b/FireBase/Offline/OfflineEntry.cs index 3b862cb..dfd5910 100644 --- a/FireBase/Offline/OfflineEntry.cs +++ b/FireBase/Offline/OfflineEntry.cs @@ -1,7 +1,6 @@ namespace Firebase.Database.Offline { using System; - using Newtonsoft.Json; /// <summary> @@ -18,16 +17,17 @@ /// <param name="obj"> The object. </param> /// <param name="priority"> The priority. Objects with higher priority will be synced first. Higher number indicates higher priority. </param> /// <param name="syncOptions"> The sync options. </param> - public OfflineEntry(string key, object obj, string data, int priority, SyncOptions syncOptions, bool isPartial = false) + public OfflineEntry(string key, object obj, string data, int priority, SyncOptions syncOptions, + bool isPartial = false) { - this.Key = key; - this.Priority = priority; - this.Data = data; - this.Timestamp = DateTime.UtcNow; - this.SyncOptions = syncOptions; - this.IsPartial = isPartial; + Key = key; + Priority = priority; + Data = data; + Timestamp = DateTime.UtcNow; + SyncOptions = syncOptions; + IsPartial = isPartial; - this.dataInstance = obj; + dataInstance = obj; } /// <summary> @@ -45,63 +45,39 @@ /// <summary> /// Initializes a new instance of the <see cref="OfflineEntry"/> class. /// </summary> - public OfflineEntry() + public OfflineEntry() { } /// <summary> /// Gets or sets the key of this entry. /// </summary> - public string Key - { - get; - set; - } + public string Key { get; set; } /// <summary> /// Gets or sets the priority. Objects with higher priority will be synced first. Higher number indicates higher priority. /// </summary> - public int Priority - { - get; - set; - } + public int Priority { get; set; } /// <summary> /// Gets or sets the timestamp when this entry was last touched. /// </summary> - public DateTime Timestamp - { - get; - set; - } + public DateTime Timestamp { get; set; } /// <summary> /// Gets or sets the <see cref="SyncOptions"/> which define what sync state this entry is in. /// </summary> - public SyncOptions SyncOptions - { - get; - set; - } + public SyncOptions SyncOptions { get; set; } /// <summary> /// Gets or sets serialized JSON data. /// </summary> - public string Data - { - get; - set; - } + public string Data { get; set; } /// <summary> /// Specifies whether this is only a partial object. /// </summary> - public bool IsPartial - { - get; - set; - } + public bool IsPartial { get; set; } /// <summary> /// Deserializes <see cref="Data"/> into <typeparamref name="T"/>. The result is cached. @@ -110,7 +86,7 @@ /// <returns> Instance of <typeparamref name="T"/>. </returns> public T Deserialize<T>() { - return (T)(this.dataInstance ?? (this.dataInstance = JsonConvert.DeserializeObject<T>(this.Data))); + return (T) (dataInstance ?? (dataInstance = JsonConvert.DeserializeObject<T>(Data))); } } -} +}
\ No newline at end of file |