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.
Data that supports the business rule defined in evaluate(). Consider this immutable. Expect to create a new Condition instance if its data needs to be changed.
Helps identify the purpose of the Condition. Impacts:
Protected
defaultSupplies the Condition's default Category
Static
DefaultProtected
loggerProvides an API for logging, sending entries to the loggerService.
Implementation for IMessageTokenSource. Conditions havea number of values that are appropriate for tokens on the ConditionConfig. Examples:
An array. If an empty array if there are no token to offer. This base class has no tokens to offer.
Protected
generateUtility to create a condition to use as a child condition. It uses the conditionFactory. If the factory throws an exception, it logs the error and returns a condition that always returns Undetermined to allow execution to continue.
Protected
tryConverts 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.
The value to be converted.
The lookup key associated with the value. Often this should be assigned to valueHost.getDataType().
The conversion lookup key to be used for conversion. Often this comes from conversionLookupKey or secondConversionLookupKey found on the Config object.
The services
An object containing the converted value, lookup key, and a flag indicating if the conversion failed.
Optional
value?: anyOptional
lookupProtected
ensureProtected
logUtility to log when a conditionConfig property is incorrectly setup.
Protected
throwLogs the invalid property data and throws a CodingError.
The name of the invalid property.
The error message describing the invalid property data.
The value host services.
Protected
logReport a comparison error where the data types of the two values are mismatched.
Protected
logLogs a message indicating that the specified property lacks a value to evaluate.
The name of the property.
The value host services.
Protected
conditionA service to provide all ValueHostNames that have been assigned to this Condition's Config.
Evaluates the child condition and returns the opposite result, unless the child condition returns Undetermined.
Generated using TypeDoc v0.25.12
Negates the result of a single child condition. Does nothing if the child condition results in Undetermined. Does not support Promises at this time.