Compare the ValueHost's value against a second ValueHost, from CompareToSecondValueHostConditionBaseConfig.secondValueHostName.

Subclasses implement the actual comparison operator (equals, greater than, etc)

Supports tokens: {CompareTo}, the value from the second value host.

Type Parameters

Hierarchy (view full)

Constructors

Accessors

  • get conditionType(): string
  • A unique identifier for the specific implementation, like "RequireText" or "Range". Its value appears in the IssueFound that comes from Validation, and in IssueFound that comes from retrieving a list of errors to display. It allows the consumer of both to correlate those instances with the specific condition. When defining conditions through a ConditionConfig, the Type property must be assigned with a valid ConditionType. This property always returns what the user supplied in the Config.conditionType, not the default conditiontype. That allows multiple instances of the same condition Class to participate in one validator's list of conditions, because each has a unique ConditionType.

    Returns string

  • get category(): ConditionCategory
  • Helps identify the purpose of the Condition. Impacts:

    • Sort order of the list of Conditions evaluated by an Validator, placing Require first and DataTypeCheck second.
    • Sets InputValueHostConfig.requiresInput.
    • Sets ValidatorConfig.severity when undefined, where Require and DataTypeCheck will use Severe. Others will use Error. Many Conditions have this value predefined. However, all will let the user override it with ConditionConfig.category.

    Returns ConditionCategory

Methods

  • Converts the given value and lookup key using the provided conversion lookup key. If the conversion fails, a warning log is generated. Takes no action if the conversionLookupKey is null.

    Parameters

    • value: any

      The value to be converted.

    • valueLookupKey: undefined | null | string

      The lookup key associated with the value. Often this should be assigned to valueHost.getDataType().

    • conversionLookupKey: undefined | null | string

      The conversion lookup key to be used for conversion. Often this comes from conversionLookupKey or secondConversionLookupKey found on the Config object.

    • services: IValueHostsServices

      The services

    Returns {
        value?: any;
        lookupKey?: null | string;
        failed: boolean;
    }

    An object containing the converted value, lookup key, and a flag indicating if the conversion failed.

    • Optional value?: any
    • Optional lookupKey?: null | string
    • failed: boolean

Generated using TypeDoc v0.25.12