Package com.marslib.util
Class ReplayIOFactory
java.lang.Object
com.marslib.util.ReplayIOFactory
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 Summary
Modifier and TypeMethodDescriptionstatic <T> TcreateProxy(Class<T> ioInterface) Creates a dynamic proxy for the given interface type that does nothing.
-
Method Details
-
createProxy
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.
-