MigrateExpression

This commit is contained in:
ousttrue
2021-01-26 18:18:07 +09:00
parent b2fd1dc8ce
commit 24e16077b5
3 changed files with 185 additions and 3 deletions

View File

@@ -28,6 +28,19 @@ namespace UniJSON
return self.Children.Count() / 2;
}
public static string GetObjectValueOrDefault<T>(this ListTreeNode<T> self, String key, string defualtValue)
where T : IListTreeItem, IValue<T>
{
try
{
return self[key].GetString();
}
catch (KeyNotFoundException)
{
return defualtValue;
}
}
public static ListTreeNode<T> GetObjectItem<T>(this ListTreeNode<T> self, String key)
where T : IListTreeItem, IValue<T>
{