Interface UnifiedTypeFactory

  • All Known Implementing Classes:
    ReflectionClassFactory

    public interface UnifiedTypeFactory
    Factory for XClass implementations based on a given java.lang.Class or a javax.lang.model.type.TypeMirror. The factory must ensure it returns the exact same XClass instance for multiple calls with the exact same parameter, or a parameter that represents the same type, either in the form of a java.lang.Class or a javax.lang.model.type.TypeMirror. This ensures that XClasses can be safely compared by reference equality.
    Since:
    4.3
    Author:
    [email protected]
    • Method Detail

      • fromClass

        XClass fromClass​(Class<?> clazz)
        Wraps the given Class in an XClass.
        Parameters:
        clazz - can be null
        Returns:
        the wrapper XClass, or null iff the actual argument is null
      • fromTypeMirror

        XClass fromTypeMirror​(TypeMirror typeMirror)
        Wraps the given TypeMirror in an XClass.
        Parameters:
        typeMirror - can be null
        Returns:
        the wrapper XClass, or null iff the actual argument is null