Package io.dropwizard.util
Class Generics
- java.lang.Object
-
- io.dropwizard.util.Generics
-
public class Generics extends Object
Helper methods for class type parameters.- See Also:
- Super Type Tokens
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Class<?>
getTypeParameter(Class<?> klass)
Finds the type parameter for the given class.static <T> Class<T>
getTypeParameter(Class<?> klass, Class<? super T> bound)
Finds the type parameter for the given class which is assignable to the bound class.
-
-
-
Method Detail
-
getTypeParameter
public static Class<?> getTypeParameter(Class<?> klass)
Finds the type parameter for the given class.- Parameters:
klass
- a parameterized class- Returns:
- the class's type parameter
-
getTypeParameter
public static <T> Class<T> getTypeParameter(Class<?> klass, Class<? super T> bound)
Finds the type parameter for the given class which is assignable to the bound class.- Type Parameters:
T
- the type bound- Parameters:
klass
- a parameterized classbound
- the type bound- Returns:
- the class's type parameter
-
-