Package xyz.srnyx.annoyingapi
Class AnnoyingReflections
java.lang.Object
xyz.srnyx.annoyingapi.AnnoyingReflections
- All Implemented Interfaces:
org.reflections.util.NameHelper
This class is a modified version of
Reflections used for automatic Registrable in AnnoyingPlugin
Only made this to avoid a logger being created which caused an irrelevant error to be logged on start-up
It has the added bonus of less logic which makes it about 7x faster (about 46ms faster with 2 packages, 19 total classes)
-
Field Summary
Fields inherited from interface org.reflections.util.NameHelper
primitiveDescriptors, primitiveNames, primitiveTypes -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.reflections.util.NameHelper
forClass, forConstructor, forElement, forField, forMember, forMethod, forName, forNames, forNames, toName, toName, toName, toName, toName, toNames, toNames
-
Constructor Details
-
AnnoyingReflections
protected AnnoyingReflections()Constructs a new instance ofAnnoyingReflections
-
-
Method Details
-
getSubTypesOf
@NotNull public static <T> @NotNull Set<Class<? extends T>> getSubTypesOf(@NotNull @NotNull Set<String> packages, @NotNull @NotNull Class<T> type) Get all classes that are assignable to the given type- Type Parameters:
T- the type to check- Parameters:
packages- the packages to scantype- the type to check- Returns:
- a set of classes that are assignable to the given type
-