jOOQ / jOOR

jOOR - Fluent Reflection in Java jOOR is a very simple fluent API that gives access to your Java Class structures in a more intuitive way. The JDK's reflection APIs are hard and verbose to use. Other languages have much simpler constructs to access type meta information at runtime. Let us make Java reflection better.
http://www.jooq.org/products
Apache License 2.0
2.8k stars 377 forks source link

Make Reflect.wrapper(Class<?>) generic #114

Closed lukaseder closed 3 years ago

lukaseder commented 3 years ago

The Reflect.wrapper(Class<?>) method could be generic:

public static <T> Class<T> wrapper(Class<T> type)

The method either returns the argument itself, if it is already a reference type, or it turns int.class into Integer.class. But both of these class literals have the same type:

Class<Integer> i1 = int.class;
Class<Integer> i2 = Integer.class;

So, we can guarantee that the <T> type is maintained in this method.