Class ProcessingUtils

java.lang.Object
com.github.chhorz.openapi.common.util.ProcessingUtils

public class ProcessingUtils extends Object
  • Constructor Details

  • Method Details

    • doesTypeDiffer

      public boolean doesTypeDiffer(TypeMirror typeMirrorOne, TypeMirror typeMirrorTwo)
      Check if both types are not equal. The check consists of Types.isSameType(TypeMirror, TypeMirror) and a string comparison
      Parameters:
      typeMirrorOne - the first type
      typeMirrorTwo - the second type
      Returns:
      true if both types are equal
    • isSameType

      public boolean isSameType(TypeMirror typeMirror, Class<?> clazz)
      Checks if the given type is of a certain class.
      Parameters:
      typeMirror - the type that should be checked
      clazz - the requested class
      Returns:
      true if the given type is of the given class
    • isAssignableTo

      public boolean isAssignableTo(TypeMirror typeMirror, Class<?> clazz)
      Checks if the given type is assignable to the type of a given class.
      Parameters:
      typeMirror - the type that should be checked
      clazz - the requested class
      Returns:
      true if the type is assignable to the class type
    • isTypeInPackage

      public boolean isTypeInPackage(TypeMirror typeMirror, PackageElement packageElement)
      Checks if the given type resides within the given package.
      Parameters:
      typeMirror - the requested type
      packageElement - the given package
      Returns:
      true if the type resides in the given package
    • isInterface

      public boolean isInterface(TypeMirror typeMirror)
      Checks if the given type belongs to an interface element.
      Parameters:
      typeMirror - the requested type
      Returns:
      true if the type is an interface
    • removeEnclosingType

      public TypeMirror[] removeEnclosingType(TypeMirror originalReturnType, Class<?> removableClass)
    • createTypeMirrorFromString

      public TypeMirror createTypeMirrorFromString(String typeString)
    • getShortName

      public static String getShortName(TypeMirror typeMirror)
    • populateTypeParameterMap

      public Map<TypeMirror,Map<TypeParameterElement,TypeMirror>> populateTypeParameterMap(TypeElement typeElement, Map<TypeMirror,Map<TypeParameterElement,TypeMirror>> typeParameterMap)