Skip to content

Commit c9fc8fb

Browse files
committed
add EzyDictionaries.cs
1 parent 195dea1 commit c9fc8fb

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

util/EzyDictionaries.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using System.Collections.Generic;
2+
3+
namespace com.tvd12.ezyfoxserver.client.util
4+
{
5+
public sealed class EzyDictionaries
6+
{
7+
private EzyDictionaries()
8+
{
9+
}
10+
11+
public static V getOrDefault<K, V>(
12+
IDictionary<K, V> dict,
13+
K key,
14+
V defaultValue
15+
)
16+
{
17+
return dict.ContainsKey(key) ? dict[key] : defaultValue;
18+
}
19+
}
20+
}

0 commit comments

Comments
 (0)