Class JTypes


  • public final class JTypes
    extends java.lang.Object
    The factory for generating simple types.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static JType $t​(java.lang.Class<?> clazz)
      Return the type corresponding to the given class.
      static JType $t​(java.lang.String name)
      Return a type corresponding to a class with the given name.
      static JType $t​(JClassDef classDef)
      Return the erased type of a class definition.
      static JType typeNamed​(java.lang.String name)
      Return a type corresponding to a class with the given name.
      static JType typeOf​(java.lang.Class<?> clazz)
      Return the type corresponding to the given class.
      static JType typeOf​(javax.lang.model.type.TypeMirror typeMirror)
      Get a JType that corresponds to the given TypeMirror for annotation processors.
      static JType typeOf​(JClassDef classDef)
      Return the erased type of a class definition.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • $t

        public static JType $t​(JClassDef classDef)
        Return the erased type of a class definition.
        Parameters:
        classDef - the class definition
        Returns:
        the type
      • $t

        public static JType $t​(java.lang.Class<?> clazz)
        Return the type corresponding to the given class.
        Parameters:
        clazz - the class
        Returns:
        the type
      • $t

        public static JType $t​(java.lang.String name)
        Return a type corresponding to a class with the given name.
        Parameters:
        name - the class name
        Returns:
        the type
      • typeOf

        public static JType typeOf​(JClassDef classDef)
        Return the erased type of a class definition.
        Parameters:
        classDef - the class definition
        Returns:
        the type
      • typeOf

        public static JType typeOf​(java.lang.Class<?> clazz)
        Return the type corresponding to the given class.
        Parameters:
        clazz - the class
        Returns:
        the type
      • typeNamed

        public static JType typeNamed​(java.lang.String name)
        Return a type corresponding to a class with the given name.
        Parameters:
        name - the class name
        Returns:
        the type
      • typeOf

        public static JType typeOf​(javax.lang.model.type.TypeMirror typeMirror)
        Get a JType that corresponds to the given TypeMirror for annotation processors.
        Parameters:
        typeMirror - the type mirror
        Returns:
        the JType