From ec5037c01868fecaec2eba89b975f3e53aded89a Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sat, 30 Apr 2016 17:20:53 +0100 Subject: Export from java-mammoth 5f538798b147f0e76 --- Mammoth/SimpleResult.cs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Mammoth/SimpleResult.cs (limited to 'Mammoth/SimpleResult.cs') diff --git a/Mammoth/SimpleResult.cs b/Mammoth/SimpleResult.cs new file mode 100644 index 0000000..f20cd42 --- /dev/null +++ b/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