Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Read/ReadConversionCollector.cs =================================================================== diff -u -r4afb3d635232a5570c867f890f2c8b4f973ea7f7 -r7733004c163f4ccfd4211a5b58d880f5da6df24c --- Application/Ringtoets/src/Application.Ringtoets.Storage/Read/ReadConversionCollector.cs (.../ReadConversionCollector.cs) (revision 4afb3d635232a5570c867f890f2c8b4f973ea7f7) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Read/ReadConversionCollector.cs (.../ReadConversionCollector.cs) (revision 7733004c163f4ccfd4211a5b58d880f5da6df24c) @@ -57,6 +57,9 @@ private readonly Dictionary surfaceLines = CreateDictionary(); + private readonly Dictionary macroStabilityInwardsStochasticSoilModels = + CreateDictionary(); + private readonly Dictionary macroStabilityInwardsStochasticSoilProfiles = CreateDictionary(); @@ -139,7 +142,7 @@ /// The to check for. /// true if the was read before, false otherwise. /// Thrown when is null. - internal bool Contains(StochasticSoilModelEntity entity) + internal bool ContainsPipingStochasticSoilModel(StochasticSoilModelEntity entity) { if (entity == null) { @@ -157,9 +160,9 @@ /// Thrown when is null. /// Thrown when no read operation has been registered for /// . - /// Use to find out + /// Use to find out /// whether a read operation has been registered for . - internal PipingStochasticSoilModel Get(StochasticSoilModelEntity entity) + internal PipingStochasticSoilModel GetPipingStochasticSoilModel(StochasticSoilModelEntity entity) { if (entity == null) { @@ -175,6 +178,70 @@ } } + /// + /// Registers a read operation for and the + /// that was constructed with the information. + /// + /// The that was read. + /// The that was constructed. + /// Thrown when any of the input parameters is null. + internal void Read(StochasticSoilModelEntity entity, MacroStabilityInwardsStochasticSoilModel model) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + + macroStabilityInwardsStochasticSoilModels[entity] = model; + } + + /// + /// Checks whether a read operations has been registered for the given . + /// + /// The to check for. + /// true if the was read before, false otherwise. + /// Thrown when is null. + internal bool ContainsMacroStabilityInwardsStochasticSoilModel(StochasticSoilModelEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + return macroStabilityInwardsStochasticSoilModels.ContainsKey(entity); + } + + /// + /// Obtains the which was read + /// for the given . + /// + /// The for which a read + /// operation has been registered. + /// The constructed . + /// Thrown when is null. + /// Thrown when no read operation has been registered for + /// . + /// Use to find out + /// whether a read operation has been registered for . + internal MacroStabilityInwardsStochasticSoilModel GetMacroStabilityInwardsStochasticSoilModel(StochasticSoilModelEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + try + { + return macroStabilityInwardsStochasticSoilModels[entity]; + } + catch (KeyNotFoundException e) + { + throw new InvalidOperationException(e.Message, e); + } + } + #endregion #region PipingStochasticSoilProfileEntity: Read, Contains, Get