Class ReplayIOFactory

java.lang.Object
com.marslib.util.ReplayIOFactory

public final class ReplayIOFactory extends Object
A utility class that uses Java dynamic proxies to automatically construct no-op instances of hardware IO interfaces. This ensures that when in REPLAY mode, the RobotContainer does not need boilerplate anonymous class instantiations, saving lines of code and ensuring all default methods are properly bypassed.
  • Method Details

    • createProxy

      public static <T> T createProxy(Class<T> ioInterface)
      Creates a dynamic proxy for the given interface type that does nothing. This is meant to be used for AdvantageKit log replays.
      Type Parameters:
      T - The type of the IO interface.
      Parameters:
      ioInterface - The Class object representing the IO interface.
      Returns:
      A no-op instance of the interface.