Class AnnoyingReflections

java.lang.Object
xyz.srnyx.annoyingapi.AnnoyingReflections
All Implemented Interfaces:
org.reflections.util.NameHelper

public class AnnoyingReflections extends 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
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Constructs a new instance of AnnoyingReflections
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T> @NotNull Set<Class<? extends T>>
    getSubTypesOf(@NotNull Set<String> packages, @NotNull 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 Details

    • AnnoyingReflections

      protected AnnoyingReflections()
      Constructs a new instance of AnnoyingReflections
  • 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 scan
      type - the type to check
      Returns:
      a set of classes that are assignable to the given type