Package com.kamikazejam.kamicommon.util
Class ReflectionUtil
java.lang.Object
com.kamikazejam.kamicommon.util.ReflectionUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends Annotation>
TgetAnnotation(Field field, Class<T> annotationClass) static <T> @NotNull Constructor<T> getConstructor(Class<?> clazz, Class<?>... parameterTypes) static <T> Tstatic @NotNull Fieldstatic <T> Tstatic @NotNull Methodstatic @NotNull Methodstatic <T> TgetSingletonInstance(@NotNull Class<?> clazz) static <T> TgetSingletonInstanceFirstCombatible(Iterable<Class<?>> classes, T fallback) static Class<?> getSuperclassDeclaringField(@NotNull Class<?> clazz, boolean includeSelf, String fieldName) static Class<?> getSuperclassDeclaringMethod(@NotNull Class<?> clazz, boolean includeSelf, String methodName) getSuperclasses(@NotNull Class<?> clazz, boolean includeSelf) static @Nullable Class<?> getSuperclassPredicate(@NotNull Class<?> clazz, boolean includeSelf, @NotNull Predicate<Class<?>> predicate) static <T> TinvokeMethod(@NotNull Method method, @Nullable Object target) static <T> TinvokeMethod(@NotNull Method method, @Nullable Object target, @Nullable Object argument) static <T> TinvokeMethod(Method method, @Nullable Object target, Object... arguments) static booleanisRawTypeAssignableFrom(Type a, Type b) static booleanisRawTypeAssignableFromAny(Type goal, Type @NotNull ... subjects) static voidmakeAccessible(Constructor<?> constructor) static voidmakeAccessible(Field field) static voidmakeAccessible(Method method) static voidstatic void
-
Constructor Details
-
ReflectionUtil
public ReflectionUtil()
-
-
Method Details
-
getConstructor
@Contract("null, _ -> fail") @NotNull public static <T> @NotNull Constructor<T> getConstructor(Class<?> clazz, Class<?>... parameterTypes) -
makeAccessible
-
makeAccessible
-
makeAccessible
-
getSuperclassDeclaringMethod
-
getSuperclassDeclaringField
-
getSuperclassPredicate
-
getSuperclasses
-
getAnnotation
@Contract("null, _ -> fail; !null, null -> fail") @Nullable public static <T extends Annotation> T getAnnotation(Field field, Class<T> annotationClass) -
getSingletonInstance
-
getSingletonInstanceFirstCombatible
-
getMethod
-
getMethod
-
invokeMethod
-
invokeMethod
-
invokeMethod
-
isRawTypeAssignableFromAny
-
isRawTypeAssignableFrom
-
getField
-
getField
-
getField
-
setField
-
setField
-