Class Utils

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

@Internal public final class Utils extends Object
Some util methods.
Since:
4.4.0
  • Field Details

  • Method Details

    • init

      public static void init(io.micronaut.inject.visitor.VisitorContext context)
    • getMediaType

      public static io.micronaut.http.MediaType getMediaType(String mediaTypeName)
      Get or create MediaType object by name.
      Parameters:
      mediaTypeName - name of mediaType
      Returns:
      MediaType object
    • normalizeEnumValues

      public static <T extends Enum<T>> void normalizeEnumValues(Map<CharSequence,Object> paramValues, Map<String,Class<T>> enumTypes)
      Normalizes enum values stored in the map.
      Type Parameters:
      T - enum class
      Parameters:
      paramValues - The values
      enumTypes - The enum types.
    • findAndRemoveDuplicates

      public static <T> List<T> findAndRemoveDuplicates(List<T> elements, BiPredicate<T,T> predicate)
      Find and remove duplicates in lists.
      Type Parameters:
      T - elements class
      Parameters:
      elements - list of elements
      predicate - predicate for calculating duplicate element
      Returns:
      list of elements without duplicates
    • resolveComponents

      public static io.swagger.v3.oas.models.Components resolveComponents(io.swagger.v3.oas.models.OpenAPI openApi)
      Resolve the components.
      Parameters:
      openApi - The open API
      Returns:
      The components
    • resolveWebhooks

      public static Map<String,io.swagger.v3.oas.models.PathItem> resolveWebhooks(io.swagger.v3.oas.models.OpenAPI openApi)
      Resolve the webhooks.
      Parameters:
      openApi - The open API
      Returns:
      The webhooks
    • resolveOpenApi

      public static io.swagger.v3.oas.models.OpenAPI resolveOpenApi(io.micronaut.inject.visitor.VisitorContext context)
      Resolve the OpenAPI instance.
      Parameters:
      context - The context
      Returns:
      The OpenAPI instance
    • printStackTrace

      public static String printStackTrace(Throwable t)
      Return stacktrace for throwable and message.
      Parameters:
      t - throwable
      Returns:
      stacktrace
    • isTestMode

      public static boolean isTestMode()
    • getTestReference

      public static io.swagger.v3.oas.models.OpenAPI getTestReference()
    • setTestReference

      public static void setTestReference(io.swagger.v3.oas.models.OpenAPI testReference)
    • getTestReferences

      public static Map<Pair<String,String>,OpenApiInfo> getTestReferences()
    • setTestReferences

      public static void setTestReferences(Map<Pair<String,String>,OpenApiInfo> testReferences)
    • getTestYamlReference

      public static String getTestYamlReference()
    • setTestYamlReference

      public static void setTestYamlReference(String testYamlReference)
    • getTestJsonReference

      public static String getTestJsonReference()
    • getTestFileName

      public static String getTestFileName()
    • setTestFileName

      public static void setTestFileName(String testFileName)
    • setTestJsonReference

      public static void setTestJsonReference(String testJsonReference)
    • getJavadocParser

      public static JavadocParser getJavadocParser()
    • setJavadocParser

      public static void setJavadocParser(JavadocParser javadocParser)
    • getAllKnownVersions

      public static Set<String> getAllKnownVersions()
    • setAllKnownVersions

      public static void setAllKnownVersions(Set<String> allKnownVersions)
    • getAllKnownGroups

      public static Set<String> getAllKnownGroups()
    • setAllKnownGroups

      public static void setAllKnownGroups(Set<String> allKnownGroups)
    • getEndpointInfos

      public static Map<String,List<EndpointInfo>> getEndpointInfos()
    • setEndpointInfos

      public static void setEndpointInfos(Map<String,List<EndpointInfo>> endpointInfos)
    • getOpenApis

      public static Map<String,io.swagger.v3.oas.models.OpenAPI> getOpenApis()
    • setOpenApis

      public static void setOpenApis(Map<String,io.swagger.v3.oas.models.OpenAPI> openApis)
    • getIncludedClassesGroups

      public static Map<String,List<String>> getIncludedClassesGroups()
    • setIncludedClassesGroups

      public static void setIncludedClassesGroups(Map<String,List<String>> includedClassesGroups)
    • getIncludedClassesGroupsExcluded

      public static Map<String,List<String>> getIncludedClassesGroupsExcluded()
    • setIncludedClassesGroupsExcluded

      public static void setIncludedClassesGroupsExcluded(Map<String,List<String>> includedClassesGroupsExcluded)
    • getCreatorConstructorsCache

      public static Map<String,io.micronaut.inject.ast.MethodElement> getCreatorConstructorsCache()
    • getJsonMapper

      public static com.fasterxml.jackson.databind.ObjectMapper getJsonMapper()
    • getYamlMapper

      public static com.fasterxml.jackson.databind.ObjectMapper getYamlMapper()
    • isOpenapi31

      public static boolean isOpenapi31()
    • setOpenapi31

      public static void setOpenapi31(boolean openapi31)
    • clean

      public static void clean()