public final class InterceptorUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static Interceptor |
constant(Object value)
Creates an
Interceptor which always returns a constant value (for all methods). |
static Interceptor |
invoking(Invoker invoker)
Creates an
Interceptor that delegates to the specified Invoker. |
static Interceptor |
provider(ObjectProvider<?> provider)
Creates an
Interceptor which returns the resulting object from an object provider (for all methods). |
static Interceptor |
throwing(Exception e)
Creates an
Interceptor which throws a specific exception (for all methods). |
static Interceptor |
throwing(ObjectProvider<? extends Exception> provider)
Creates an
Interceptor which throws the exception provided by an object provider (for all methods). |
public static Interceptor constant(Object value)
Interceptor which always returns a constant value (for all methods).value - the constantInterceptor which always returns a constant value (for all methods)public static Interceptor provider(ObjectProvider<?> provider)
Interceptor which returns the resulting object from an object provider (for all methods).provider - the object providerInterceptor which returns the resulting object from an object provider (for all methods)public static Interceptor throwing(Exception e)
Interceptor which throws a specific exception (for all methods).e - the exceptionInterceptor which throws a specific exception (for all methods)public static Interceptor throwing(ObjectProvider<? extends Exception> provider)
Interceptor which throws the exception provided by an object provider (for all methods).provider - the object providerInterceptor which throws the exception provided by an object provider (for all methods)public static Interceptor invoking(Invoker invoker)
Interceptor that delegates to the specified Invoker.invoker - delegateInterceptorCopyright © 2005–2014 The Apache Software Foundation. All rights reserved.