Class ClassUtils

java.lang.Object
org.springframework.integration.util.ClassUtils

public abstract class ClassUtils
extends java.lang.Object
Since:
2.0
  • Field Summary

    Fields 
    Modifier and Type Field Description
    static java.lang.reflect.Method FUNCTION_APPLY_METHOD
    The Function.apply(Object) method object.
    static java.lang.reflect.Method HANDLER_HANDLE_METHOD
    The org.springframework.integration.handler.GenericHandler#handle(Object, Map) method object.
    static java.lang.Class<?> KOTLIN_FUNCTION_0_CLASS
    The kotlin.jvm.functions.Function0 class object.
    static java.lang.reflect.Method KOTLIN_FUNCTION_0_INVOKE_METHOD
    The kotlin.jvm.functions.Function0#invoke method object.
    static java.lang.Class<?> KOTLIN_FUNCTION_1_CLASS
    The kotlin.jvm.functions.Function1 class object.
    static java.lang.Class<?> KOTLIN_UNIT_CLASS
    The kotlin.Unit class object.
    static java.lang.reflect.Method SELECTOR_ACCEPT_METHOD
    The org.springframework.integration.core.GenericSelector#accept(Object) method object.
    static java.lang.reflect.Method SUPPLIER_GET_METHOD
    The Supplier.get() method object.
    static java.lang.reflect.Method TRANSFORMER_TRANSFORM_METHOD
    The org.springframework.integration.transformer.GenericTransformer#transform(Object) method object.
  • Constructor Summary

    Constructors 
    Constructor Description
    ClassUtils()  
  • Method Summary

    Modifier and Type Method Description
    static java.lang.Class<?> findClosestMatch​(java.lang.Class<?> type, java.util.Set<java.lang.Class<?>> candidates, boolean failOnTie)  
    static boolean isKotlinFaction0​(java.lang.Class<?> aClass)
    Deprecated.
    since 5.5.14 in favor of isKotlinFunction0(Class)
    static boolean isKotlinFaction1​(java.lang.Class<?> aClass)
    Deprecated.
    since 5.5.14 in favor of isKotlinFunction1(Class)
    static boolean isKotlinFunction0​(java.lang.Class<?> aClass)
    Check if class is kotlin.jvm.functions.Function0.
    static boolean isKotlinFunction1​(java.lang.Class<?> aClass)
    Check if class is kotlin.jvm.functions.Function1.
    static boolean isKotlinUnit​(java.lang.Class<?> aClass)
    Check if class is kotlin.Unit.
    static boolean isLambda​(java.lang.Class<?> aClass)
    Check if class is Java or Kotlin lambda.
    static java.lang.Class<?> resolvePrimitiveType​(java.lang.Class<?> clazz)
    Resolve the given class if it is a primitive wrapper class, returning the corresponding primitive type instead.

    Methods inherited from class java.lang.Object

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

    • FUNCTION_APPLY_METHOD

      public static final java.lang.reflect.Method FUNCTION_APPLY_METHOD
      The Function.apply(Object) method object.
    • SUPPLIER_GET_METHOD

      public static final java.lang.reflect.Method SUPPLIER_GET_METHOD
      The Supplier.get() method object.
    • SELECTOR_ACCEPT_METHOD

      public static final java.lang.reflect.Method SELECTOR_ACCEPT_METHOD
      The org.springframework.integration.core.GenericSelector#accept(Object) method object.
    • TRANSFORMER_TRANSFORM_METHOD

      public static final java.lang.reflect.Method TRANSFORMER_TRANSFORM_METHOD
      The org.springframework.integration.transformer.GenericTransformer#transform(Object) method object.
    • HANDLER_HANDLE_METHOD

      public static final java.lang.reflect.Method HANDLER_HANDLE_METHOD
      The org.springframework.integration.handler.GenericHandler#handle(Object, Map) method object.
    • KOTLIN_FUNCTION_0_CLASS

      public static final java.lang.Class<?> KOTLIN_FUNCTION_0_CLASS
      The kotlin.jvm.functions.Function0 class object.
    • KOTLIN_FUNCTION_0_INVOKE_METHOD

      public static final java.lang.reflect.Method KOTLIN_FUNCTION_0_INVOKE_METHOD
      The kotlin.jvm.functions.Function0#invoke method object.
    • KOTLIN_FUNCTION_1_CLASS

      public static final java.lang.Class<?> KOTLIN_FUNCTION_1_CLASS
      The kotlin.jvm.functions.Function1 class object.
    • KOTLIN_UNIT_CLASS

      public static final java.lang.Class<?> KOTLIN_UNIT_CLASS
      The kotlin.Unit class object.
  • Constructor Details

  • Method Details

    • findClosestMatch

      public static java.lang.Class<?> findClosestMatch​(java.lang.Class<?> type, java.util.Set<java.lang.Class<?>> candidates, boolean failOnTie)
    • resolvePrimitiveType

      @Nullable public static java.lang.Class<?> resolvePrimitiveType​(java.lang.Class<?> clazz)
      Resolve the given class if it is a primitive wrapper class, returning the corresponding primitive type instead.
      Parameters:
      clazz - the wrapper class to check
      Returns:
      the corresponding primitive if the clazz is a wrapper, otherwise null
    • isLambda

      public static boolean isLambda​(java.lang.Class<?> aClass)
      Check if class is Java or Kotlin lambda.
      Parameters:
      aClass - the Class to check.
      Returns:
      true if class is a Java or Kotlin lambda.
      Since:
      5.2
    • isKotlinFaction0

      @Deprecated public static boolean isKotlinFaction0​(java.lang.Class<?> aClass)
      Deprecated.
      since 5.5.14 in favor of isKotlinFunction0(Class)
      Check if class is kotlin.jvm.functions.Function0.
      Parameters:
      aClass - the Class to check.
      Returns:
      true if class is a kotlin.jvm.functions.Function0 implementation.
      Since:
      5.2
    • isKotlinFunction0

      public static boolean isKotlinFunction0​(java.lang.Class<?> aClass)
      Check if class is kotlin.jvm.functions.Function0.
      Parameters:
      aClass - the Class to check.
      Returns:
      true if class is a kotlin.jvm.functions.Function0 implementation.
      Since:
      5.5.14
    • isKotlinFaction1

      @Deprecated public static boolean isKotlinFaction1​(java.lang.Class<?> aClass)
      Deprecated.
      since 5.5.14 in favor of isKotlinFunction1(Class)
      Check if class is kotlin.jvm.functions.Function1.
      Parameters:
      aClass - the Class to check.
      Returns:
      true if class is a kotlin.jvm.functions.Function1 implementation.
      Since:
      5.2
    • isKotlinFunction1

      public static boolean isKotlinFunction1​(java.lang.Class<?> aClass)
      Check if class is kotlin.jvm.functions.Function1.
      Parameters:
      aClass - the Class to check.
      Returns:
      true if class is a kotlin.jvm.functions.Function1 implementation.
      Since:
      5.5.14
    • isKotlinUnit

      public static boolean isKotlinUnit​(java.lang.Class<?> aClass)
      Check if class is kotlin.Unit.
      Parameters:
      aClass - the Class to check.
      Returns:
      true if class is a kotlin.Unit implementation.
      Since:
      5.3.2