Class MoreTypes


  • public class MoreTypes
    extends java.lang.Object
    Static util methods related to TypeMirror
    • Constructor Summary

      Constructors 
      Constructor Description
      MoreTypes()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static javax.lang.model.type.ArrayType asArray​(javax.lang.model.type.TypeMirror maybeArrayType)
      Returns a ArrayType if the TypeMirror represents a primitive array or throws an IllegalArgumentException.
      static javax.lang.model.type.DeclaredType asDeclared​(javax.lang.model.type.TypeMirror maybeDeclaredType)
      Returns a DeclaredType if the TypeMirror represents a declared type such as a class, interface, union/compound, or enum or throws an IllegalArgumentException.
      static javax.lang.model.type.ExecutableType asExecutable​(javax.lang.model.type.TypeMirror maybeExecutableType)
      Returns a ExecutableType if the TypeMirror represents an executable type such as a method, constructor, or initializer or throws an IllegalArgumentException.
      static javax.lang.model.type.PrimitiveType asPrimitiveType​(javax.lang.model.type.TypeMirror maybePrimitiveType)
      Returns a PrimitiveType if the TypeMirror represents a primitive type or throws an IllegalArgumentException.
      • Methods inherited from class java.lang.Object

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

      • MoreTypes

        public MoreTypes()
    • Method Detail

      • asExecutable

        public static javax.lang.model.type.ExecutableType asExecutable​(javax.lang.model.type.TypeMirror maybeExecutableType)
        Returns a ExecutableType if the TypeMirror represents an executable type such as a method, constructor, or initializer or throws an IllegalArgumentException.
      • asArray

        public static javax.lang.model.type.ArrayType asArray​(javax.lang.model.type.TypeMirror maybeArrayType)
        Returns a ArrayType if the TypeMirror represents a primitive array or throws an IllegalArgumentException.
      • asDeclared

        public static javax.lang.model.type.DeclaredType asDeclared​(javax.lang.model.type.TypeMirror maybeDeclaredType)
        Returns a DeclaredType if the TypeMirror represents a declared type such as a class, interface, union/compound, or enum or throws an IllegalArgumentException.
      • asPrimitiveType

        public static javax.lang.model.type.PrimitiveType asPrimitiveType​(javax.lang.model.type.TypeMirror maybePrimitiveType)
        Returns a PrimitiveType if the TypeMirror represents a primitive type or throws an IllegalArgumentException.