Class OverrideLoader

java.lang.Object
org.egothor.methodatlas.command.OverrideLoader

public final class OverrideLoader extends Object
Loads classification override files into ClassificationOverride instances.

Override files carry human-reviewed corrections to AI classification results. They are persisted in YAML using the ClassificationOverride schema and re-applied on every subsequent MethodAtlas run so that reviewer decisions reproduce deterministically across CI builds.

Null handling

Passing null as the override path is a legitimate signal that the caller wants the empty no-op singleton — typical when no -override-file flag was supplied. The loader returns ClassificationOverride.empty() in that case rather than throwing, because the absence of an override file is normal, not exceptional.

Thread safety

This class is thread-safe. It carries no instance state and the underlying ClassificationOverride.load(Path) call is itself stateless.

Since:
1.0.0
See Also:
  • ClassificationOverride
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new override loader.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.egothor.methodatlas.emit.ClassificationOverride
    load(Path overrideFile)
    Loads the classification override file at the given path, or returns the empty no-op singleton when no override file was configured.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • OverrideLoader

      public OverrideLoader()
      Creates a new override loader. The loader carries no instance state.
  • Method Details

    • load

      public org.egothor.methodatlas.emit.ClassificationOverride load(Path overrideFile)
      Loads the classification override file at the given path, or returns the empty no-op singleton when no override file was configured.

      The empty singleton is a sentinel: callers can apply it unconditionally to every classification without checking for null, which simplifies the orchestration loops in the Command implementations.

      Parameters:
      overrideFile - path to the YAML override file, or null when the caller wants the empty no-op singleton
      Returns:
      loaded override set, or the empty singleton; never null
      Throws:
      IllegalArgumentException - if the file exists but cannot be read or contains invalid YAML