Class
caplin.trading.validation

OneOfValidator

The OneOfValidator is a caplin.trading.validation.Validator that verifies that the specified field values are one of the allowed field values. This class is immutable.

Constructor Summary

Attributes Name and Description
caplin.trading.validation.OneOfValidator(Array l_pFields, Array l_pAllowedValues)

The constructor for the OneOfValidator.

Method Summary

Attributes Name and Description
String validateField(String sFieldValue)

Performs validation on the specified field to determine if it is one of the allowed field values.

Methods inherited from class caplin.trading.validation.Validator:
validate

Constructor Detail

caplin.trading.validation.OneOfValidator(Array l_pFields, Array l_pAllowedValues)

The constructor for the OneOfValidator.

Parameters
Array l_pFields An array of string field names that must be present in the data to validate. Must not be null.
Array l_pAllowedValues An array of allowed field values.
Throws
caplin.core.Error
if the list of fields is not an array of strings, or the allowed values is not an array of strings.

Method Detail

String validateField(String sFieldValue)

Performs validation on the specified field to determine if it is one of the allowed field values.

Parameters
String sFieldValue The field value to validate.
Returns
An error message indicating the validation failure, or null if no errors occurred.