Class TypeReflectHelper

java.lang.Object
io.ebeaninternal.server.type.TypeReflectHelper

public final class TypeReflectHelper extends Object
  • Constructor Details

    • TypeReflectHelper

      public TypeReflectHelper()
  • Method Details

    • typeVariableMap

      public static Map<TypeVariable<?>, Type> typeVariableMap(Class<?> targetType)
      Return the full map of TypeVariable to resolved Type for the given class and its entire superclass/interface hierarchy. Used to resolve generic field types in mapped superclasses.
    • getParams

      public static Class<?>[] getParams(Class<?> cls, Class<?> matchRawType)
    • asEnumClass

      public static Class<? extends Enum<?>> asEnumClass(Type valueType)
      Return the enum class for this type taking into account wildcard type.
    • isEnumType

      public static boolean isEnumType(Type valueType)
      Return true if the type is an enum.
    • getMapKeyType

      public static Class<?> getMapKeyType(Type genericType)
      Return the type of the map key.
    • getMapKeyTypeRaw

      public static Type getMapKeyTypeRaw(Type genericType)
      Return the raw type of the map key (first type argument).
    • getValueType

      public static Type getValueType(Type collectionType)
      Return the value type of a collection type (list, set, map values).
    • resolveToClass

      public static Class<?> resolveToClass(Type type)
      Return the raw Class for a Type, handling Class, ParameterizedType, and WildcardType. Returns null when the raw class cannot be determined.
    • resolveCollectionTarget

      public static Class<?> resolveCollectionTarget(Type typeArg)
      Return the element class for a collection or map type argument (handles Class, ParameterizedType raw, and Kotlin-generated wildcard upper bounds).
    • resolveType

      public static Type resolveType(Type type, Map<TypeVariable<?>, Type> typeMap)
      Resolve a Type through the given type-variable map, recursively substituting any bound TypeVariables and rebuilding ParameterizedTypes whose arguments changed.