Class ClassLoadReport

java.lang.Object
de.tomatengames.util.ClassLoadReport

public class ClassLoadReport extends Object
A ClassLoadReport captures the results of attempting to load various classes, including both successful loads and failures.
Since:
1.8
  • Constructor Details

    • ClassLoadReport

      public ClassLoadReport()
      Constructs a new, empty ClassLoadReport.
  • Method Details

    • addLoadedClass

      public void addLoadedClass(Class<?> cls)
      Adds a successfully loaded class to the report.
      Parameters:
      cls - the class that was loaded
    • addFailedClass

      public void addFailedClass(String className, Throwable error)
      Adds information about a failed class load attempt to the report.
      Parameters:
      className - the fully qualified name of the class that failed to load
      error - the exception or error that occurred during loading
    • getLoadedClasses

      public List<Class<?>> getLoadedClasses()
      Returns a list of all successfully loaded classes.
      Returns:
      a list of Class objects representing the loaded classes
    • getFailedClasses

      public List<ClassLoadReport.ClassLoadError> getFailedClasses()
      Returns a list of all failed class load attempts.
      Returns:
      a list of ClassLoadError objects representing the failed loads
    • getFailedClassesMap

      public Map<String, Throwable> getFailedClassesMap()
      Returns a map of the failed class load attempts where the key is the class name and the value is the corresponding Throwable error.
      Returns:
      a map with class names as keys and Throwable errors as values representing the failed loads
    • addAll

      public void addAll(ClassLoadReport other)
      Merges another ClassLoadReport into this report by adding all its results to this ClassLoadReport.
      Parameters:
      other - the other ClassLoadReport to merge