On Sep 23, 2014, at 16:59, Emmanuel Bernard <emman...@hibernate.org> wrote:

>> Reread the other email again and actually it could be used to show
>> different permutations like the retry case (eq RETRIED_CREATE), but it
>> seems like the code in that one method would get pretty complex pretty
>> fast having to handle all the various cases.
> 
> If the combiname becomes complicated for a specific complex filter, nothing 
> prevents the implementor to split it into different methods
> 
> public boolean filter(Key key, Value old, Value new, EventType eventType, 
> Metadata metadata) {
>     switch(eventType) {
>         case CREATE:
>             return filterForCreate(…);
>             break;
>         ….
>         default:
>             throw new AssertionFailure(“oops: “ + eventType);
>     }
> }
> 
> private boolean filterForCreate(…) {
>     ….
> }

We can provide this as a default abstract impl for the Functional interface
Cheers,
-- 
Mircea Markus
Infinispan lead (www.infinispan.org)





_______________________________________________
infinispan-dev mailing list
infinispan-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/infinispan-dev

Reply via email to