public class DuckTypeProxyFactory extends Object
Constructor and Description |
---|
DuckTypeProxyFactory() |
Modifier and Type | Method and Description |
---|---|
static <T> T |
newLooseProxyInstance(Class<T> proxyInterface,
Object delegate)
Creates a new Proxy instance for the given interface.
|
static <T> T |
newStrictProxyInstance(Class<T> proxyInterface,
Object delegate)
Creates a new Proxy instance for the given interface.
|
public static <T> T newStrictProxyInstance(Class<T> proxyInterface, Object delegate)
If any methods are called on the interface that are not defined in the delegate, then it will throw UnsupportedOperationException.
T
- Type of the interfaceproxyInterface
- the interface to create a proxy for.delegate
- the object to delegate to for implementations (quacks like a duck)public static <T> T newLooseProxyInstance(Class<T> proxyInterface, Object delegate)
If any methods are called on the interface that are not defined in the delegate, then it will return null.
T
- Type of the interfaceproxyInterface
- the interface to create a proxy for.delegate
- the object to delegate to for implementations (quacks like a duck)Copyright © 2002-2021 Atlassian. All Rights Reserved.