-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New Accessor for common metadata of StacItem
- Loading branch information
1 parent
d979da4
commit 07eb788
Showing
6 changed files
with
180 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Net; | ||
using System.Runtime.Serialization; | ||
using System.Threading.Tasks; | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Linq; | ||
using Stac.Catalog; | ||
using Stac.Collection; | ||
using Stac.Extensions; | ||
using Stac.Item; | ||
using Stac.Model; | ||
|
||
namespace Stac | ||
{ | ||
public static class StacAccessorsHelpers | ||
{ | ||
|
||
public static void SetProperty(this IStacObject stacObject, string key, object value) | ||
{ | ||
stacObject.Properties.Remove(key); | ||
stacObject.Properties.Add(key, value); | ||
} | ||
|
||
public static T GetProperty<T>(this IStacObject stacObject, string key) | ||
{ | ||
if (!stacObject.Properties.ContainsKey(key)) | ||
return default(T); | ||
return (T)stacObject.Properties[key]; | ||
} | ||
|
||
} | ||
} |
This file was deleted.
Oops, something went wrong.