UNPKG

@accordproject/concerto-core

Version:

Core Implementation for the Concerto Modeling Language

52 lines (51 loc) 1.75 kB
declare const Validator: any; /** * A Validator to enforce that non null numeric values are between two values. * @private * @class * @memberof module:concerto-core */ declare class NumberValidator extends Validator { /** * Create a NumberValidator. * @param {Object} field - the field or scalar declaration this validator is attached to * @param {Object} ast - The ast for the range defined as [lower,upper] (inclusive). * * @throws {IllegalModelException} */ constructor(field: any, ast: any); /** * Returns the lower bound for this validator, or null if not specified * @returns {number} the lower bound or null */ getLowerBound(): any; /** * Returns the upper bound for this validator, or null if not specified * @returns {number} the upper bound or null */ getUpperBound(): any; /** * Validate the property * @param {string} identifier the identifier of the instance being validated * @param {Object} value the value to validate * @throws {IllegalModelException} * @private */ validate(identifier: any, value: any): void; /** * Returns a string representation * @return {string} the string representation * @private */ toString(): string; /** * Determine if the validator is compatible with another validator. For the * validators to be compatible, all values accepted by this validator must * be accepted by the other validator. * @param {Validator} other the other validator. * @returns {boolean} True if this validator is compatible with the other * validator, false otherwise. */ compatibleWith(other: any): boolean; } export = NumberValidator;