Class ElementUtils

java.lang.Object
io.micronaut.openapi.visitor.ElementUtils

@Internal public final class ElementUtils extends Object
Some util methods.
Since:
4.8.3
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final List<String>
     
    static final List<String>
     
    static final List<String>
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    isContainerType(io.micronaut.inject.ast.ClassElement type)
    Checking if the type is container.
    static boolean
    isFileUpload(io.micronaut.inject.ast.ClassElement type)
    Checking if the type is file upload type.
    static boolean
    isNullable(io.micronaut.inject.ast.TypedElement element)
    Checks Nullable annotions / optinal type to understand that the element can be null.
    static boolean
    isReactiveAndVoid(io.micronaut.inject.ast.ClassElement type)
    Checking if the type is void.
    static boolean
    isReturnTypeFile(io.micronaut.inject.ast.ClassElement type)
    Checking if the type is file.
    static boolean
    isVoid(io.micronaut.inject.ast.ClassElement type)
    Checking if the type is void.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • CONTAINER_TYPES

      public static final List<String> CONTAINER_TYPES
    • FILE_TYPES

      public static final List<String> FILE_TYPES
    • VOID_TYPES

      public static final List<String> VOID_TYPES
  • Method Details

    • isNullable

      public static boolean isNullable(io.micronaut.inject.ast.TypedElement element)
      Checks Nullable annotions / optinal type to understand that the element can be null.
      Parameters:
      element - typed element
      Returns:
      true if element is nullable, false - otherwise.
    • isFileUpload

      public static boolean isFileUpload(io.micronaut.inject.ast.ClassElement type)
      Checking if the type is file upload type.
      Parameters:
      type - type element
      Returns:
      true if this type one of known file upload types
    • isReturnTypeFile

      public static boolean isReturnTypeFile(io.micronaut.inject.ast.ClassElement type)
      Checking if the type is file.
      Parameters:
      type - type element
      Returns:
      true if this type assignable with known file types
    • isContainerType

      public static boolean isContainerType(io.micronaut.inject.ast.ClassElement type)
      Checking if the type is container.
      Parameters:
      type - type element
      Returns:
      true if this type assignable with known container types
    • isVoid

      public static boolean isVoid(io.micronaut.inject.ast.ClassElement type)
      Checking if the type is void.
      Parameters:
      type - type element
      Returns:
      true if this type assignable with known void types
    • isReactiveAndVoid

      public static boolean isReactiveAndVoid(io.micronaut.inject.ast.ClassElement type)
      Checking if the type is void.
      Parameters:
      type - type element
      Returns:
      true if this type assignable with known container and type argument is void