| Constructor and Description |
|---|
ShadowFactory()
Constructs a new shadow factory.
|
| Modifier and Type | Method and Description |
|---|---|
<T extends Shadow> |
constructShadow(@NonNull Class<T> shadowClass,
Object... args)
Creates a shadow for the given object, by invoking a constructor on the shadows
target.
|
<T extends Shadow> |
constructShadow(@NonNull Class<T> shadowClass,
ShadowingStrategy.Unwrapper unwrapper,
Object... args)
Creates a shadow for the given object, by invoking a constructor on the shadows
target.
|
static ShadowFactory |
global()
Returns a shared static
ShadowFactory instance. |
void |
registerTargetResolver(@NonNull TargetResolver targetResolver)
Registers a target resolver with the shadow factory.
|
<T extends Shadow> |
shadow(@NonNull Class<T> shadowClass,
@NonNull Object handle)
Creates a shadow for the given object.
|
<T extends Shadow> |
staticShadow(@NonNull Class<T> shadowClass)
Creates a static shadow for the given class.
|
public static ShadowFactory global()
ShadowFactory instance.public final <T extends Shadow> T shadow(@NonNull Class<T> shadowClass, @NonNull Object handle)
T - the shadow typeshadowClass - the class of the shadow definitionhandle - the handle objectpublic final <T extends Shadow> T staticShadow(@NonNull Class<T> shadowClass)
T - the shadow typeshadowClass - the class of the shadow definitionpublic final <T extends Shadow> T constructShadow(@NonNull Class<T> shadowClass, Object... args)
T - the shadow typeshadowClass - the class of the shadow definitionargs - the arguments to pass to the constructorpublic final <T extends Shadow> T constructShadow(@NonNull Class<T> shadowClass, ShadowingStrategy.Unwrapper unwrapper, Object... args)
T - the shadow typeshadowClass - the class of the shadow definitionunwrapper - the unwrapper to useargs - the arguments to pass to the constructorpublic final void registerTargetResolver(@NonNull TargetResolver targetResolver)
targetResolver - the resolver