Class ClassUtils
java.lang.Object
org.springframework.data.repository.util.ClassUtils
Deprecated, for removal: This API element is subject to removal in a future version.
Utility class to work with classes.
- Author:
- Oliver Gierke, Mark Paluch, Johannes Englmeier
- 
Method SummaryModifier and TypeMethodDescriptionstatic voidassertReturnTypeAssignable(Method method, Class<?>... types) Deprecated, for removal: This API element is subject to removal in a future version.Asserts the givenMethod's return type to be one of the given types.static intgetNumberOfOccurences(Method method, Class<?> type) Deprecated.static intgetNumberOfOccurrences(Method method, Class<?> parameterType) Deprecated, for removal: This API element is subject to removal in a future version.Returns the number of occurrences for the givenparameter typein the givenMethod.static booleanhasParameterAssignableToType(Method method, Class<?> type) Deprecated, for removal: This API element is subject to removal in a future version.Returns whether the givenMethodhas a parameter that is assignable to the given type.static booleanhasParameterOfType(Method method, Class<?> type) Deprecated, for removal: This API element is subject to removal in a future version.Returns whether the givenMethodhas a parameter of the given type.static booleanhasProperty(Class<?> type, String property) Deprecated, for removal: This API element is subject to removal in a future version.Returns whether the given class contains a property with the given name.static voidifPresent(String className, ClassLoader classLoader, Consumer<Class<?>> action) Deprecated, for removal: This API element is subject to removal in a future version.static booleanisGenericRepositoryInterface(Class<?> interfaze) Deprecated, for removal: This API element is subject to removal in a future version.Returns wthere the given type is theRepositoryinterface.static booleanisGenericRepositoryInterface(String interfaceName) Deprecated, for removal: This API element is subject to removal in a future version.Returns whether the given type name is a repository interface name.static booleanisOfType(Object object, Collection<Class<?>> types) Deprecated, for removal: This API element is subject to removal in a future version.Returns whether the given object is of one of the given types.static voidDeprecated, for removal: This API element is subject to removal in a future version.Helper method to extract the original exception that can possibly occur during a reflection call.
- 
Method Details- 
hasPropertyDeprecated, for removal: This API element is subject to removal in a future version.Returns whether the given class contains a property with the given name.- Parameters:
- type-
- property-
- Returns:
 
- 
ifPresentpublic static void ifPresent(String className, @Nullable ClassLoader classLoader, Consumer<Class<?>> action) Deprecated, for removal: This API element is subject to removal in a future version.Determine whether theClassidentified by the suppliedclassNameis present * and can be loaded and call theactionif theClasscould be loaded.- Parameters:
- className- the name of the class to check.
- classLoader- the class loader to use.
- action- the action callback to notify. (may be- nullwhich indicates the default class loader)
- Throws:
- IllegalStateException- if the corresponding class is resolvable but there was a readability mismatch in the inheritance hierarchy of the class (typically a missing dependency declaration in a Jigsaw module definition for a superclass or interface implemented by the class to be checked here)
 
- 
isGenericRepositoryInterfaceDeprecated, for removal: This API element is subject to removal in a future version.Returns wthere the given type is theRepositoryinterface.- Parameters:
- interfaze-
- Returns:
 
- 
isGenericRepositoryInterfaceDeprecated, for removal: This API element is subject to removal in a future version.Returns whether the given type name is a repository interface name.- Parameters:
- interfaceName-
- Returns:
 
- 
getNumberOfOccurencesDeprecated.
- 
getNumberOfOccurrencesDeprecated, for removal: This API element is subject to removal in a future version.Returns the number of occurrences for the givenparameter typein the givenMethod.- Parameters:
- method-- Methodto evaluate.
- parameterType-- Classof the- Methodparameter type to count.
- Returns:
- the number of occurrences for the given parameter typein the givenMethod.
- See Also:
 
- 
assertReturnTypeAssignableDeprecated, for removal: This API element is subject to removal in a future version.Asserts the givenMethod's return type to be one of the given types. Will unwrap known wrapper types before the assignment check (seeQueryExecutionConverters).- Parameters:
- method- must not be null.
- types- must not be null or empty.
 
- 
isOfTypeDeprecated, for removal: This API element is subject to removal in a future version.Returns whether the given object is of one of the given types. Will return false for null.- Parameters:
- object-
- types-
- Returns:
 
- 
hasParameterOfTypeDeprecated, for removal: This API element is subject to removal in a future version.Returns whether the givenMethodhas a parameter of the given type.- Parameters:
- method-
- type-
- Returns:
 
- 
hasParameterAssignableToTypeDeprecated, for removal: This API element is subject to removal in a future version.Returns whether the givenMethodhas a parameter that is assignable to the given type.- Parameters:
- method-
- type-
- Returns:
 
- 
unwrapReflectionExceptionDeprecated, for removal: This API element is subject to removal in a future version.Helper method to extract the original exception that can possibly occur during a reflection call.- Parameters:
- ex-
- Throws:
- Throwable
 
 
- 
ClassUtilsinstead.