java.lang.Object
com.weirddev.testme.intellij.template.context.Type

public class Type extends Object
A used type - object or primitive. Date: 24/10/2016
Author:
Yaron Yamin
  • Constructor Details

    • Type

      @Deprecated public Type(String canonicalName, String name, String packageName, boolean isPrimitive, boolean isInterface, boolean isAbstract, boolean array, int arrayDimensions, boolean varargs, List<Type> composedTypes)
      Deprecated.
    • Type

      public Type(com.intellij.psi.PsiType psiType, @Nullable @Nullable Object typePsiElement, @Nullable @Nullable TypeDictionary typeDictionary, int maxRecursionDepth, boolean shouldResolveAllMethods)
    • Type

      public Type(com.intellij.psi.PsiClass psiClass, TypeDictionary typeDictionary, int maxRecursionDepth, boolean shouldResolveAllMethods)
  • Method Details

    • resolveType

      @NotNull public static @NotNull com.intellij.psi.PsiClassType resolveType(com.intellij.psi.PsiClass psiClass)
    • resolveDependencies

      public void resolveDependencies(@Nullable @Nullable TypeDictionary typeDictionary, int maxRecursionDepth, com.intellij.psi.PsiType psiType, boolean shouldResolveAllMethods)
    • findConstructors

      public List<Method> findConstructors()
      Find methods that are constructors
      Returns:
      Type's constructors sorted in revers order by no. of constructor params
    • hasConstructor

      public boolean hasConstructor()
      Returns:
      true if type has constructor
    • getCanonicalName

      public String getCanonicalName()
      Full canonical name including package
    • getName

      public String getName()
      Type's name
    • isPrimitive

      public boolean isPrimitive()
      true - if this type is a primitive. i.e. int, boolean
    • getPackageName

      public String getPackageName()
      Type's package
    • getComposedTypes

      public List<Type> getComposedTypes()
      Used types of generic params if relevant
    • isArray

      public boolean isArray()
      true when type is an array
    • getArrayDimensions

      public int getArrayDimensions()
      no. of array dimensions. relevant only in case this type is an array
    • isVarargs

      public boolean isVarargs()
      true when this type is a varar
    • isEnum

      public boolean isEnum()
      true if this type is an enum
    • getEnumValues

      public List<String> getEnumValues()
      enum name values. relevant for enum types
    • isInterface

      public boolean isInterface()
      true if this type is an interface
    • isAbstract

      public boolean isAbstract()
      true if this type is an abstract class
    • isStatic

      public boolean isStatic()
      true if this is a static type/class or a Scala Object
    • isFinal

      public boolean isFinal()
      true if type id defined as final
    • getParentContainerClass

      public Type getParentContainerClass()
      in case this is an inner class - the outer class where this type is defined
    • isDependenciesResolved

      public boolean isDependenciesResolved()
      true when all constructor dependencies, if exists, have been resolved by object graph introspection
    • isDependenciesResolvable

      public boolean isDependenciesResolvable()
      used internally when building object graph
    • isHasDefaultConstructor

      public boolean isHasDefaultConstructor()
      true when type has a default constructor
    • isCaseClass

      public boolean isCaseClass()
      true - if this is a scala case class
    • isSealed

      public boolean isSealed()
      true - if this is a scala sealed class
    • getMethods

      public List<Method> getMethods()
      type's methods if relevant
    • getFields

      public List<Field> getFields()
      fields defined for this type
    • getImplementedInterfaces

      public List<Type> getImplementedInterfaces()
      interfaces implemented by this type if any
    • getChildObjectsQualifiedNames

      public List<String> getChildObjectsQualifiedNames()
      relevant of scala sealed classes
    • isAnnotatedByDI

      public boolean isAnnotatedByDI()
      is type annotated with dependency injection annotations,
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object