Class ConversionTypes

java.lang.Object
com.ultikits.ultitools.config.convert.builtin.ConversionTypes

@Internal public final class ConversionTypes extends Object
Type resolution for reflective declarations, generic ancestors, bounds, and arrays.
  • Constructor Details

    • ConversionTypes

      private ConversionTypes()
  • Method Details

    • raw

      public static Class<?> raw(Type type)
      Parameters:
      type - the declared type
      Returns:
      its erased class after resolving bounds
    • bound

      public static Type bound(Type type)
      Parameters:
      type - the declared type
      Returns:
      its effective bound
    • component

      public static Type component(Type type)
      Parameters:
      type - an array declaration
      Returns:
      its full component type
    • argument

      public static Type argument(Type type, Class<?> ancestor, int index)
      Resolves the arguments of a generic ancestor, including concrete subclasses.
      Parameters:
      type - the declared class or parameterized type
      ancestor - the collection/map ancestor
      index - the requested ancestor argument
      Returns:
      the substituted type, or Object for a raw declaration
    • boxed

      public static Class<?> boxed(Class<?> type)
      Parameters:
      type - primitive or reference class
      Returns:
      its wrapper or itself