diff options
| author | Michael Williamson <mike@zwobble.org> | 2016-04-17 18:57:29 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2016-04-17 18:58:12 +0100 |
| commit | 52140d52210eda0f25ecab9f89b5c73473e9d8e0 (patch) | |
| tree | cb383edb71e44b8ae7b2b0d0890f13574d1922f0 /dotnet/Mammoth/SimpleResult.cs | |
| parent | 0f9ef005f063198ea2e16ca36beaead4bd5e3824 (diff) | |
Add CLI for .NET version
Diffstat (limited to 'dotnet/Mammoth/SimpleResult.cs')
| -rw-r--r-- | dotnet/Mammoth/SimpleResult.cs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/dotnet/Mammoth/SimpleResult.cs b/dotnet/Mammoth/SimpleResult.cs new file mode 100644 index 0000000..f20cd42 --- /dev/null +++ b/dotnet/Mammoth/SimpleResult.cs @@ -0,0 +1,22 @@ +using System.Collections.Generic; +using Mammoth.Couscous; +using Mammoth.Couscous.org.zwobble.mammoth.@internal.results; + +namespace Mammoth { + internal static class SimpleResult { + internal static IResult<T> ToResult<T>(this InternalResult<T> result) { + var warnings = new HashSet<string>(FromJava.IterableToEnumerable(result.getWarnings())); + return new SimpleResult<T>(result.getValue(), warnings); + } + } + + internal class SimpleResult<T> : IResult<T> { + public T Value { get; } + public ISet<string> Warnings { get; } + + internal SimpleResult(T value, ISet<string> warnings) { + Value = value; + Warnings = warnings; + } + } +} |
