NotableDateRule Class
Definition
- Namespace
- Bodu.Globalization.Calendar
- Assembly
- Bodu.Globalization.Calendar.dll
- Package
- Bodu.Globalization.Calendar 1.0.1
- Source
- NotableDateRule.cs
Represents one way of calculating a notable-date concept: an applicability scope, exactly one occurrence source (a single-date calculation strategy or a recurrence strategy), an optional duration, and the adjustment policies that transform its occurrences.
public sealed class NotableDateRule
- Inheritance
-
NotableDateRule
- Inherited Members
- Extension Methods
Remarks
A rule is identified within its notable-date concept by its Id. Optional Category, NonWorking, and Duration values override the inherited defaults of the parent concept; when null the parent value applies.
A rule declares exactly one occurrence source: either a single-date Strategy that yields at most one occurrence per year, or a Recurrence strategy that yields many occurrences within a window. Exactly one of the two is non-null.
Constructors
NotableDateRule(string, int, NotableDateCategory?, bool?, NotableDateDurationDefinition?, RuleApplicability, IDateCalculationStrategy, IEnumerable<string>, IEnumerable<string>)
Initializes a new instance of the NotableDateRule class with a single-date calculation strategy.
public NotableDateRule(string id, int priority, NotableDateCategory? category, bool? nonWorking, NotableDateDurationDefinition? duration, RuleApplicability applicability, IDateCalculationStrategy strategy, IEnumerable<string> adjustmentPolicyRefs, IEnumerable<string> tags)
Parameters
idstringThe stable identifier of the rule within its notable-date concept.
priorityintThe selection priority of the rule.
categoryNotableDateCategory?The category override, or null to inherit the concept's category.
nonWorkingbool?The non-working-day override, or null to inherit the concept's default.
durationNotableDateDurationDefinitionThe duration override, or null to inherit the concept's default.
applicabilityRuleApplicabilityThe territory, calendar, and year applicability of the rule.
strategyIDateCalculationStrategyThe single-date calculation strategy of the rule.
adjustmentPolicyRefsIEnumerable<string>The identifiers of the adjustment policies applied to the rule.
tagsIEnumerable<string>The rule-specific tags.
Exceptions
- ArgumentNullException
id,applicability,strategy,adjustmentPolicyRefs, ortagsis null.
NotableDateRule(string, int, NotableDateCategory?, bool?, NotableDateDurationDefinition?, RuleApplicability, IDateRecurrenceStrategy, IEnumerable<string>, IEnumerable<string>)
Initializes a new instance of the NotableDateRule class with a recurrence strategy.
public NotableDateRule(string id, int priority, NotableDateCategory? category, bool? nonWorking, NotableDateDurationDefinition? duration, RuleApplicability applicability, IDateRecurrenceStrategy recurrence, IEnumerable<string> adjustmentPolicyRefs, IEnumerable<string> tags)
Parameters
idstringThe stable identifier of the rule within its notable-date concept.
priorityintThe selection priority of the rule.
categoryNotableDateCategory?The category override, or null to inherit the concept's category.
nonWorkingbool?The non-working-day override, or null to inherit the concept's default.
durationNotableDateDurationDefinitionThe duration override, or null to inherit the concept's default.
applicabilityRuleApplicabilityThe territory, calendar, and year applicability of the rule.
recurrenceIDateRecurrenceStrategyThe recurrence strategy of the rule.
adjustmentPolicyRefsIEnumerable<string>The identifiers of the adjustment policies applied to the rule.
tagsIEnumerable<string>The rule-specific tags.
Exceptions
- ArgumentNullException
id,applicability,recurrence,adjustmentPolicyRefs, ortagsis null.
Properties
AdjustmentPolicyRefs
Gets the identifiers of the adjustment policies applied to the rule.
public IReadOnlyList<string> AdjustmentPolicyRefs { get; }
Property Value
- IReadOnlyList<string>
The referenced policy ids; empty when the rule has no adjustments.
Applicability
Gets the territory, calendar, and year applicability of the rule.
public RuleApplicability Applicability { get; }
Property Value
Category
Gets the category override of the rule.
public NotableDateCategory? Category { get; }
Property Value
- NotableDateCategory?
The category, or null when the concept's category is inherited.
Duration
Gets the duration override of the rule.
public NotableDateDurationDefinition? Duration { get; }
Property Value
- NotableDateDurationDefinition
The duration definition, or null when the concept's default duration is inherited.
DurationDays
Gets the explicit fixed-duration override of the rule, in days.
public int? DurationDays { get; }
Property Value
Id
Gets the stable identifier of the rule within its notable-date concept.
public string Id { get; }
Property Value
- string
The rule id.
NonWorking
Gets the non-working-day override of the rule.
public bool? NonWorking { get; }
Property Value
Priority
Gets the selection priority of the rule.
public int Priority { get; }
Property Value
- int
The numeric priority.
Recurrence
Gets the recurrence strategy of the rule.
public IDateRecurrenceStrategy? Recurrence { get; }
Property Value
- IDateRecurrenceStrategy
The IDateRecurrenceStrategy, or null when the rule uses a single-date strategy.
Strategy
Gets the single-date calculation strategy of the rule.
public IDateCalculationStrategy? Strategy { get; }
Property Value
- IDateCalculationStrategy
The IDateCalculationStrategy, or null when the rule uses a recurrence source.
Tags
Gets the rule-specific tags.
public IReadOnlyList<string> Tags { get; }
Property Value
- IReadOnlyList<string>
The tags; empty when the rule declares none.
Applies to
| Product | Versions |
|---|---|
| .NET | 8, 10 |