< Summary

Information
Class: MyNet.Temporal.Decomposition.TimeSpanDecompositionOptions
Assembly: MyNet.Temporal
File(s): https://raw.githubusercontent.com/sandre58/MyNet/85372080fe102cd9ee155ceab49ae000e7f66103/src/MyNet.Temporal/Decomposition/TimeSpanDecompositionOptions.cs
Tag: 323_28699572109
Line coverage
0%
Covered lines: 0
Uncovered lines: 1
Coverable lines: 1
Total lines: 62
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.cctor()100%210%

File(s)

https://raw.githubusercontent.com/sandre58/MyNet/85372080fe102cd9ee155ceab49ae000e7f66103/src/MyNet.Temporal/Decomposition/TimeSpanDecompositionOptions.cs

#LineLine coverage
 1// -----------------------------------------------------------------------
 2// <copyright file="TimeSpanDecompositionOptions.cs" company="Stéphane ANDRE">
 3// Copyright (c) Stéphane ANDRE. All rights reserved.
 4// </copyright>
 5// -----------------------------------------------------------------------
 6
 7using MyNet.Primitives;
 8
 9namespace MyNet.Temporal.Decomposition;
 10
 11/// <summary>
 12/// Options for decomposing a TimeSpan into its component time units, allowing customization of precision, unit inclusio
 13/// </summary>
 14/// <example>
 15/// Strict mode:
 16/// new TimeSpanDecompositionOptions { }.
 17/// Fuzzy mode:
 18/// new TimeSpanDecompositionOptions { Quantizer = HumanFriendlyTimeSpanQuantizer.Current }.
 19/// </example>
 20public sealed class TimeSpanDecompositionOptions
 21{
 22    /// <summary>
 23    /// Gets the default options for decomposing a TimeSpan, which includes a precision of 1, does not count empty units
 24    /// </summary>
 025    public static TimeSpanDecompositionOptions Default { get; } = TimeSpanDecompositionPresets.Strict;
 26
 27    /// <summary>
 28    /// Gets the minimum time unit to consider in the decomposition.
 29    /// </summary>
 30    public TimeUnit MinUnit { get; init; } = TimeUnit.Millisecond;
 31
 32    /// <summary>
 33    /// Gets the maximum time unit to consider in the decomposition.
 34    /// </summary>
 35    public TimeUnit MaxUnit { get; init; } = TimeUnit.Year;
 36
 37    /// <summary>
 38    /// Gets the mode for decomposing the TimeSpan into its component time units. This determines how the decomposition 
 39    /// </summary>
 40    public TimeSpanDecompositionMode Mode { get; init; } = TimeSpanDecompositionMode.Hierarchical;
 41
 42    /// <summary>
 43    /// Gets the precision for the decomposition, which determines how many time units to include in the result. For exa
 44    /// </summary>
 45    public int? MaxComponents { get; init; }
 46
 47    /// <summary>
 48    /// Gets a value indicating whether to include time units with zero values in the decomposition result. If true, all
 49    /// </summary>
 50    public bool IncludeZeroUnits { get; init; }
 51
 52    /// <summary>
 53    /// Gets the rule engine to use for decomposing the TimeSpan into its component time units. This allows for customiz
 54    /// </summary>
 55    public ITimeUnitRuleEngine RuleEngine { get; init; } = TimeUnitRuleSelector.Default;
 56
 57    /// <summary>
 58    /// Gets the optional quantizer to apply after exact decomposition.
 59    /// </summary>
 60    public ITimeSpanQuantizer? Quantizer { get; init; }
 61}
 62

Methods/Properties

.cctor()