Class DefaultValidationRules
- Inheritance
-
DefaultValidationRules
- Inherited Members
- Assembly
- SemanticBridge.dll
Provides the default set of validation rules that match the current implementation of MetricViewValidationVisitor.
public static class DefaultValidationRules
Fields
KnownCurrencyCodes
Known ISO 4217 currency codes derived from OS locale data via RegionInfo and based on .NET System.Globalization.
public static readonly ImmutableHashSet<string> KnownCurrencyCodes
Field Value
| Type | Description |
|---|---|
| ImmutableHashSet<string> |
Remarks
This is NOT a complete ISO 4217 table — it covers active currencies that map to a real OS locale/region, but omits historical codes (e.g. DEM) and non-country codes (e.g. XAU for gold, XDR for SDR). Because of these limitations, this should ONLY be used for warnings, never errors.
TranslatableMetricViewRules
public static readonly ImmutableArray<IMetricViewValidationRule> TranslatableMetricViewRules
Field Value
| Type | Description |
|---|---|
| ImmutableArray<IMetricViewValidationRule> |
ValidMetricViewRules
List of rules used to validate a Metric View. Used in deserialization.
public static readonly ImmutableArray<IMetricViewValidationRule> ValidMetricViewRules
Field Value
| Type | Description |
|---|---|
| ImmutableArray<IMetricViewValidationRule> |
Remarks
These rules are derived from a reading of public Databricks documentation at time of Semantic Bridge development. There are no guarantees that these are complete.
Methods
ForType<T>()
Returns validation rules for the specified type.
public static IEnumerable<IMetricViewValidationRule> ForType<T>() where T : IMetricViewObject
Returns
| Type | Description |
|---|---|
| IEnumerable<IMetricViewValidationRule> | ValidMetricViewRules that apply to the specified type. |
Type Parameters
| Name | Description |
|---|---|
| T | The type of object to get rules for. |
GetByName(string)
Returns validation rules with the specified name.
public static IMetricViewValidationRule? GetByName(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The name of the rule to find. |
Returns
| Type | Description |
|---|---|
| IMetricViewValidationRule | The rule with the specified name, or null if not found. |
InCategory(string)
Returns validation rules in the specified category.
public static IEnumerable<IMetricViewValidationRule> InCategory(string category)
Parameters
| Type | Name | Description |
|---|---|---|
| string | category | The category of rules to get. |
Returns
| Type | Description |
|---|---|
| IEnumerable<IMetricViewValidationRule> | ValidMetricViewRules that belong to the specified category. |