Interface WebhookFilter
public interface WebhookFilter
Users need to implement this interface in their scripts to filter the item being sent to the destination.
This is a Groovy example of how the script should look like
class MyFilter implements WebhookFilter {
public <T extends ItemModel> Optional<T> filter(T item) {
// perform filtering
// if item is to be sent, return Optional.of(item)
// if item is not to be sent, return Optinal.empty()
Optional.of(item)
}
}
new MyFilter()
-
Method Summary
-
Method Details
-
filter
Filter the item before sending- Type Parameters:
T- The ItemModel type- Parameters:
item- The item to filter- Returns:
- Wrap the item in an
Optionalif it should be sent, e.g.Optional.of(item), if item is not to be sent, returnOptional.empty()
-