From 52140d52210eda0f25ecab9f89b5c73473e9d8e0 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sun, 17 Apr 2016 18:57:29 +0100 Subject: Add CLI for .NET version --- dotnet/Mammoth/SimpleResult.cs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 dotnet/Mammoth/SimpleResult.cs (limited to 'dotnet/Mammoth/SimpleResult.cs') 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 ToResult(this InternalResult result) { + var warnings = new HashSet(FromJava.IterableToEnumerable(result.getWarnings())); + return new SimpleResult(result.getValue(), warnings); + } + } + + internal class SimpleResult : IResult { + public T Value { get; } + public ISet Warnings { get; } + + internal SimpleResult(T value, ISet warnings) { + Value = value; + Warnings = warnings; + } + } +} -- cgit v1.2.3