Class KotlinDetector

java.lang.Object
org.springframework.core.KotlinDetector

public abstract class KotlinDetector extends Object
A common delegate for detecting Kotlin's presence and for identifying Kotlin types.
Since:
5.0
Author:
Juergen Hoeller, Sebastien Deleuze
  • Constructor Details

    • KotlinDetector

      public KotlinDetector()
  • Method Details

    • isKotlinPresent

      public static boolean isKotlinPresent()
      Determine whether Kotlin is present in general.
    • isKotlinReflectPresent

      public static boolean isKotlinReflectPresent()
      Determine whether Kotlin reflection is present.
      Since:
      5.1
    • isKotlinType

      public static boolean isKotlinType(Class<?> clazz)
      Determine whether the given Class is a Kotlin type (with Kotlin metadata present on it).

      As of Kotlin 2.0, this method can't be used to detect Kotlin lambdas unless they are annotated with @JvmSerializableLambda as invokedynamic has become the default method for lambda generation.

    • isSuspendingFunction

      public static boolean isSuspendingFunction(Method method)
      Return true if the method is a suspending function.
      Since:
      5.3
    • isInlineClass

      public static boolean isInlineClass(Class<?> clazz)
      Determine whether the given Class is an inline class (annotated with @JvmInline).
      Since:
      6.1.5
      See Also: