Event API: add Map.compute-like methods
- Dominant language
- Java
- Stars
- 14.9k
- Forks
- 3.5k
- Avg merge
- 19h 14m
- Merged PRs (30d)
- 63
Description
Add Map-like `compute`, `computeIfAbsent`, and `computeIfPresent`:
Two flavors are possible:
* source + target: `Event.compute(FieldReference source, FieldReference target, Function compute)`
* modify the field: `Event.compute(FieldReference field, Function compute)`
Mostly the positive impact is believed (per discussion with a few folks) to be around the mutate filter and script/ruby filters. For this reason, the `modify the field` option is probably a good target since we want to enable functionality with less typing for script/ruby filter users.
Proposal:
```
void compute(FieldReference, field, Function compute) throws FieldMissingException;
// most valuable, probably, for script/ruby filter users
void computeIfPresent(FieldReference, field, Function compute) throws FieldMissingException;
void computeIfAbsent(FieldReference, field, Function compute) throws FieldMissingException;
```
Contributor guide
Assessment
This issue has not been assessed yet.