-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduced new "ReadOnlyCollection" and "ReadOnlyList" classes
- Loading branch information
Showing
2 changed files
with
38 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace Skybrud.Essentials.Collections; | ||
|
||
/// <summary> | ||
/// Static class for working with <see cref="IReadOnlyCollection{T}"/>. | ||
/// </summary> | ||
public static class ReadOnlyCollection { | ||
|
||
/// <summary> | ||
/// Returns an empty instance of <see cref="IReadOnlyCollection{T}"/>. | ||
/// </summary> | ||
/// <typeparam name="T">The item type of the collection.</typeparam> | ||
/// <returns>An instance of <see cref="IReadOnlyCollection{T}"/>.</returns> | ||
public static IReadOnlyCollection<T> Empty<T>() { | ||
return ArrayUtils.Empty<T>(); | ||
} | ||
|
||
} |
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,19 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace Skybrud.Essentials.Collections; | ||
|
||
/// <summary> | ||
/// Static class for working with <see cref="IReadOnlyList{T}"/>. | ||
/// </summary> | ||
public static class ReadOnlyList { | ||
|
||
/// <summary> | ||
/// Returns an empty instance of <see cref="IReadOnlyList{T}"/>. | ||
/// </summary> | ||
/// <typeparam name="T">The item type of the list.</typeparam> | ||
/// <returns>An instance of <see cref="IReadOnlyList{T}"/>.</returns> | ||
public static IReadOnlyList<T> Empty<T>() { | ||
return ArrayUtils.Empty<T>(); | ||
} | ||
|
||
} |