Class AnnoyingReflections

  • All Implemented Interfaces:
    org.reflections.util.NameHelper

    public class AnnoyingReflections
    extends java.lang.Object
    implements 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
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T> @NotNull java.util.Set<java.lang.Class<? extends T>> getSubTypesOf​(@NotNull java.util.Set<java.lang.String> packages, @NotNull java.lang.Class<T> type)
      Get all classes that are assignable to the given type
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.reflections.util.NameHelper

        forClass, forConstructor, forElement, forField, forMember, forMethod, forName, forNames, forNames, toName, toName, toName, toName, toName, toNames, toNames
    • Constructor Detail

      • AnnoyingReflections

        protected AnnoyingReflections()
        Constructs a new instance of AnnoyingReflections
    • Method Detail

      • getSubTypesOf

        @NotNull
        public static <T> @NotNull java.util.Set<java.lang.Class<? extends T>> getSubTypesOf​(@NotNull
                                                                                             @NotNull java.util.Set<java.lang.String> packages,
                                                                                             @NotNull
                                                                                             @NotNull java.lang.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 scan
        type - the type to check
        Returns:
        a set of classes that are assignable to the given type