< prev index next >
src/java.base/share/classes/sun/misc/JavaLangAccess.java
Print this page
@@ -27,10 +27,11 @@
import java.lang.annotation.Annotation;
import java.lang.reflect.Executable;
import java.security.AccessControlContext;
import java.util.Map;
+import java.util.function.Function;
import sun.reflect.ConstantPool;
import sun.reflect.annotation.AnnotationType;
import sun.nio.ch.Interruptible;
@@ -78,10 +79,18 @@
* Class object does not represent an enum type;
* the result is uncloned, cached, and shared by all callers.
*/
<E extends Enum<E>> E[] getEnumConstantsShared(Class<E> klass);
+ /**
+ * If given Class represents a generic class or interface, then the result of
+ * applying given function to the Class object is returned, otherwise null.
+ * The result is cached in per-Class map using identity of given key.
+ */
+ <D> D getGenericDerivative(Class<?> clazz, Object key,
+ Function<Class<?>, ? extends D> function);
+
/** Set thread's blocker field. */
void blockedOn(Thread t, Interruptible b);
/**
* Registers a shutdown hook.
< prev index next >