Methods
getSubtypes() → {Set.<String>}
Get types used in this condition.
This is a type of condition that contains a subcondition. A complete set of subtypes must contain the set of types that must be supported in order to validate this fulfillment. Therefore, we need to join the type of this condition to the types used in the subcondition.
- Source:
Returns:
Complete type names for this fulfillment.
- Type
- Set.<String>
setMaxMessageLength(maxMessageLength)
Set the threshold.
Determines the threshold that is used to consider this condition fulfilled. If the number of valid subfulfillments is greater or equal to this number, the threshold condition is considered to be fulfilled.
Parameters:
Name | Type | Description |
---|---|---|
maxMessageLength |
Number | Integer threshold |
- Source:
setPrefix(prefix)
Set the prefix.
The prefix will be prepended to the message during validation before the message is passed on to the subcondition.
Parameters:
Name | Type | Description |
---|---|---|
prefix |
Buffer | Prefix to apply to the message. |
- Source:
setSubcondition(subcondition)
Set the (unfulfilled) subcondition.
Each prefix condition builds on an existing condition which is provided via this method.
Parameters:
Name | Type | Description |
---|---|---|
subcondition |
Condition | String | Condition object or URI string representing the condition that will receive the prefixed message. |
- Source:
setSubfulfillment(fulfillment)
Set the (fulfilled) subcondition.
When constructing a prefix fulfillment, this method allows you to pass in a fulfillment for the condition that will receive the prefixed message.
Note that you only have to add either the subcondition or a subfulfillment, but not both.
Parameters:
Name | Type | Description |
---|---|---|
fulfillment |
Fulfillment | String | Fulfillment object or URI string representing the fulfillment to use as the subcondition. |
- Source:
validate(message) → {Boolean}
Check whether this fulfillment meets all validation criteria.
This will validate the subfulfillment. The message will be prepended with the prefix before being passed to the subfulfillment's validation routine.
Parameters:
Name | Type | Description |
---|---|---|
message |
Buffer | Message to validate against. |
- Source:
Returns:
Whether this fulfillment is valid.
- Type
- Boolean