Methods
getBitmask() → {Number}
Get full bitmask.
This is a type of condition that contains a subcondition. A complete bitmask must contain the set of types that must be supported in order to validate this fulfillment. Therefore, we need to calculate the bitwise OR of this condition's TYPE_BIT and the subcondition's bitmask.
- Source:
Returns:
Complete bitmask for this fulfillment.
- Type
- Number
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 | Condition that will receive the prefixed message. |
- Source:
setSubconditionUri(Subcondition)
Set the (unfulfilled) subcondition.
This will automatically parse the URI and call setSubcondition.
Parameters:
| Name | Type | Description |
|---|---|---|
Subcondition |
String | URI. |
- 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 | Fulfillment to use for the subcondition. |
- Source:
setSubfulfillmentUri(Subfulfillment)
Set the (fulfilled) subcondition.
This will automatically parse the URI and call setSubfulfillment.
Parameters:
| Name | Type | Description |
|---|---|---|
Subfulfillment |
String | URI. |
- 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