IKVM11  11
Java SE 11 Virtual Machine for .NET
Loading...
Searching...
No Matches
CollectionExtensions.cs
Go to the documentation of this file.
1using System.Collections.Generic;
2
3namespace java.util
4{
5
6 public static class CollectionExtensions
7 {
8
15 public static ICollection<T> AsCollection<T>(this Collection collection) => collection switch
16 {
17 ICollection<T> c => c,
18 List l => l.AsList<T>(),
19 Set s => s.AsSet<T>(),
20 Collection c => new CollectionWrapper<T>(c),
21 };
22
23 }
24
25}
static ICollection< T > AsCollection< T >(this Collection collection)
Returns a ICollection<T> that wraps the specified Collection.