| Modifier and Type | Method and Description |
|---|---|
static Object |
cast(Object from,
Class<?>[] interfaces,
ClassLoader classLoader)
Cast object into multiple interfaces
|
static <T> T |
cast(Object from,
Class<T> interfase)
Cast object to one given interface using ClassLoader of interface
|
static <T> T |
cast(Object from,
Class<T> interfase,
ClassLoader classLoader)
Cast object to one given interface
|
static Object |
staticCast(Class<?> from,
Class<?>[] interfaces,
ClassLoader classLoader)
Cast static methods of a class to given interfaces
|
static <T> T |
staticCast(Class<?> from,
Class<T> interfase)
Cast static class to one given interface
|
static <T> T |
staticCast(Class<?> from,
Class<T> interfase,
ClassLoader classLoader)
Cast static class to one given interface
|
public static Object cast(Object from, Class<?>[] interfaces, ClassLoader classLoader) throws SecurityException, NoSuchMethodException
from - Object to castinterfaces - Interfaces to cast toclassLoader - ClassLoader to load methods for invocationSecurityExceptionNoSuchMethodExceptionpublic static <T> T cast(Object from, Class<T> interfase) throws SecurityException, NoSuchMethodException
T - Type of interfacefrom - Object to castinterfase - Interface to cast toSecurityExceptionNoSuchMethodExceptionpublic static <T> T cast(Object from, Class<T> interfase, ClassLoader classLoader) throws SecurityException, NoSuchMethodException
T - Type of interfacefrom - Object to castinterfase - Interface to cast toclassLoader - Class loader to load invocation methodsSecurityExceptionNoSuchMethodExceptionpublic static Object staticCast(Class<?> from, Class<?>[] interfaces, ClassLoader classLoader) throws SecurityException, NoSuchMethodException
from - From classinterfaces - To interfacesclassLoader - Class loaderSecurityExceptionNoSuchMethodExceptionpublic static <T> T staticCast(Class<?> from, Class<T> interfase) throws SecurityException, NoSuchMethodException
T - Type of interface to casts tofrom - Type of static class to casts frominterfase - Interface to cast toSecurityExceptionNoSuchMethodExceptionpublic static <T> T staticCast(Class<?> from, Class<T> interfase, ClassLoader classLoader) throws SecurityException, NoSuchMethodException
T - Type of interface to casts tofrom - Type of static class to casts frominterfase - Interface to cast toclassLoader - Class loader to load resultSecurityExceptionNoSuchMethodExceptionCopyright © 2008–2020. All rights reserved.