This library provides a suite of utilities for working with generic types in Java.
TypeService.reify() offers provides a powerful, extensible way to determine the generic type for, or "reify", a given Object. Under the hood, it relies on TypeExtractor implementations, allowing the user to extend its capabilities by defining new implementations.
Also of note is the interface GenericTyped, which can be implemented to quickly make any type reifiable.
Nils can best be described as a "typed null", able to generate a generic type defined by the Nil's type parameter. Given a generic type X, we can create a Type instance of X using the code
Type x = new Nil<X>() {}.getType();For example, if we wanted to specify the type Function<Double, Double>, we could write
Type functionType = new Nil<Function<Double, Double>>() {}.getType();