Class GenericTypeResolver

java.lang.Object
io.fluxzero.common.reflection.GenericTypeResolver

public class GenericTypeResolver extends Object
Utility class for resolving generic type information in class hierarchies. This class provides methods to resolve and extract generic type details, including parameterized and array types, from a given class type in relation to a target type.
  • Constructor Details

    • GenericTypeResolver

      public GenericTypeResolver()
  • Method Details

    • parameterize

      public static ParameterizedType parameterize(Class<?> rawType, Type... actualTypeArguments)
      Creates a parameterized type for a raw class and its actual type arguments.
    • getGenericType

      public static Type getGenericType(Class<?> clazz, Class<?> target)
    • resolve

      public static Type resolve(Type type, Class<?> contextType, Class<?> declaringType)
      Resolves a type declared by declaringType in the generic context of contextType.
      Parameters:
      type - declared type to resolve
      contextType - concrete subtype that supplies the type arguments
      declaringType - type that declares type