re-organized configurations - II
This commit is contained in:
		| @ -8,6 +8,7 @@ public class MetadataConfiguration | ||||
| { | ||||
|  | ||||
|     public bool? ForceMetadataLastWriteTimeToCreationTime { get; set; } | ||||
|     public string[]? IgnoreRulesKeyWords { get; set; } | ||||
|     public int? Offset { get; set; } | ||||
|     public bool? PropertiesChangedForMetadata { get; set; } | ||||
|  | ||||
| @ -34,8 +35,9 @@ public class MetadataConfiguration | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     private static void Verify(MetadataConfiguration _) | ||||
|     private static void Verify(MetadataConfiguration configuration) | ||||
|     { | ||||
|         if (configuration.IgnoreRulesKeyWords is null || configuration.IgnoreRulesKeyWords.Length == 0) throw new NullReferenceException(nameof(configuration.IgnoreRulesKeyWords)); | ||||
|     } | ||||
|  | ||||
|     private static Shared.Models.MetadataConfiguration Get(MetadataConfiguration? configuration, Shared.Models.ResultConfiguration resultConfiguration) | ||||
| @ -43,11 +45,13 @@ public class MetadataConfiguration | ||||
|         Shared.Models.MetadataConfiguration result; | ||||
|         if (configuration is null) throw new NullReferenceException(nameof(configuration)); | ||||
|         if (configuration.ForceMetadataLastWriteTimeToCreationTime is null) throw new NullReferenceException(nameof(configuration.ForceMetadataLastWriteTimeToCreationTime)); | ||||
|         if (configuration.IgnoreRulesKeyWords is null) throw new NullReferenceException(nameof(configuration.IgnoreRulesKeyWords)); | ||||
|         if (configuration.Offset is null) throw new NullReferenceException(nameof(configuration.Offset)); | ||||
|         if (configuration.PropertiesChangedForMetadata is null) throw new NullReferenceException(nameof(configuration.PropertiesChangedForMetadata)); | ||||
|         Verify(configuration); | ||||
|         result = new(resultConfiguration, | ||||
|                      configuration.ForceMetadataLastWriteTimeToCreationTime.Value, | ||||
|                      configuration.IgnoreRulesKeyWords, | ||||
|                      configuration.Offset.Value, | ||||
|                      configuration.PropertiesChangedForMetadata.Value); | ||||
|         return result; | ||||
|  | ||||
| @ -8,16 +8,16 @@ public class ResultConfiguration | ||||
| { | ||||
|  | ||||
|     public string? DateGroup { get; set; } | ||||
|     public int? EpicYear { get; set; } | ||||
|     public string? ModelName { get; set; } | ||||
|     public int? NumberOfJitters { get; set; } | ||||
|     public int? NumberOfTimesToUpsample { get; set; } | ||||
|     public string? PredictorModelName { get; set; } | ||||
|     public string? ResultAllInOne { get; set; } | ||||
|     public int? ResultAllInOneSubdirectoryLength { get; set; } | ||||
|     public string? ResultCollection { get; set; } | ||||
|     public string? ResultContent { get; set; } | ||||
|     public string? RootDirectory { get; set; } | ||||
|     public string? ResultSingleton { get; set; } | ||||
|     public string? RootDirectory { get; set; } | ||||
|  | ||||
|     public override string ToString() | ||||
|     { | ||||
| @ -53,28 +53,28 @@ public class ResultConfiguration | ||||
|         Shared.Models.ResultConfiguration result; | ||||
|         if (configuration is null) throw new NullReferenceException(nameof(configuration)); | ||||
|         if (configuration.DateGroup is null) throw new NullReferenceException(nameof(configuration.DateGroup)); | ||||
|         if (configuration.EpicYear is null) throw new NullReferenceException(nameof(configuration.EpicYear)); | ||||
|         // if (configuration.ModelName is null) throw new NullReferenceException(nameof(configuration.ModelName)); | ||||
|         // if (configuration.NumberOfJitters is null) throw new NullReferenceException(nameof(configuration.NumberOfJitters)); | ||||
|         // if (configuration.NumberOfTimesToUpsample is null) throw new NullReferenceException(nameof(configuration.NumberOfTimesToUpsample)); | ||||
|         // if (configuration.PredictorModelName is null) throw new NullReferenceException(nameof(configuration.PredictorModelName)); | ||||
|         if (configuration.ResultAllInOne is null) throw new NullReferenceException(nameof(configuration.ResultAllInOne)); | ||||
|         if (configuration.ResultAllInOneSubdirectoryLength is null) throw new NullReferenceException(nameof(configuration.ResultAllInOneSubdirectoryLength)); | ||||
|         if (configuration.ResultCollection is null) throw new NullReferenceException(nameof(configuration.ResultCollection)); | ||||
|         if (configuration.ResultContent is null) throw new NullReferenceException(nameof(configuration.ResultContent)); | ||||
|         if (configuration.RootDirectory is null) throw new NullReferenceException(nameof(configuration.RootDirectory)); | ||||
|         if (configuration.ResultSingleton is null) throw new NullReferenceException(nameof(configuration.ResultSingleton)); | ||||
|         if (configuration.RootDirectory is null) throw new NullReferenceException(nameof(configuration.RootDirectory)); | ||||
|         Verify(configuration, requireRootDirectoryExists); | ||||
|         result = new(configuration.DateGroup, | ||||
|                      configuration.EpicYear.Value, | ||||
|                      configuration.ModelName, | ||||
|                      configuration.NumberOfJitters, | ||||
|                      configuration.NumberOfTimesToUpsample, | ||||
|                      configuration.PredictorModelName, | ||||
|                      configuration.ResultAllInOne, | ||||
|                      configuration.ResultAllInOneSubdirectoryLength.Value, | ||||
|                      configuration.ResultCollection, | ||||
|                      configuration.ResultContent, | ||||
|                      Path.GetFullPath(configuration.RootDirectory), | ||||
|                      configuration.ResultSingleton); | ||||
|                      configuration.ResultSingleton, | ||||
|                      Path.GetFullPath(configuration.RootDirectory)); | ||||
|         return result; | ||||
|     } | ||||
|  | ||||
|  | ||||
		Reference in New Issue
	
	Block a user