public Object intercept()

in core/src/main/java/org/apache/commons/proxy2/interceptor/SwitchInterceptor.java [61:71]


    public Object intercept(Invocation invocation) throws Throwable
    {
        for (Pair<InvocationMatcher, Interceptor> currentCase : cases)
        {
            if (currentCase.getLeft().matches(invocation))
            {
                return currentCase.getRight().intercept(invocation);
            }
        }
        return invocation.proceed();
    }