public class Wrapper<B,D> extends Object
| Modifier | Constructor and Description |
|---|---|
protected |
Wrapper(Class<? extends B> adapterClass,
Constructor<B> ctor) |
| Modifier and Type | Method and Description |
|---|---|
static <B,D> Wrapper<B,D> |
from(Class<B> baseType,
Class<D> delegateType)
Generates a wrapper from a base type and delegate type.
|
Constructor<? extends B> |
getConstructor(Class<?>... arguments)
Returns a constructor for the generated wrapper.
|
B |
wrap(D delegate)
Returns a wrapper instance around the given delegate.
|
protected Wrapper(Class<? extends B> adapterClass, Constructor<B> ctor)
public static <B,D> Wrapper<B,D> from(Class<B> baseType, Class<D> delegateType)
baseType - must be a public interface or abstract classdelegateType - any typeIllegalArgumentException - if type parameters are unsupportedpublic B wrap(D delegate)
delegate - delegate to wrapIllegalArgumentException - if delegate is null or arguments are
requiredUndeclaredThrowableException - if constructor throws a checked exceptionpublic Constructor<? extends B> getConstructor(Class<?>... arguments) throws NoSuchMethodException
NoSuchMethodExceptionCopyright © 2006–2015 Cojen. All rights reserved.