We’ll look at EnhancedDoubleSupplier, EnhancedUnitSupplier also exists and is essentially the same, but works with Units from Util.

Constructing:

EnhancedDoubleSupplier enhancedDoubleSupplier = new EnhancedDoubleSupplier(() -> 0.0);

State:

enhancedDoubleSupplier.state();
enhancedDoubleSupplier.velocity();
enhancedDoubleSupplier.rawVelocity();
enhancedDoubleSupplier.acceleration();
enhancedDoubleSupplier.rawAcceleration();
// velocity and acceleration are captured over a window
// raw variations are not
// you can modify the measurement window
enhancedDoubleSupplier.getMeasurementWindow();
// defaults to this many seconds
enhancedDoubleSupplier.setMeasurementWindow(0.02);

// we can set the state, to give i
enhancedDoubleSupplier.state(100);

Manual update management:

// you can enable / disable the feature based auto calculations
enhancedDoubleSupplier.getAutoCalculates();
enhancedDoubleSupplier.setAutoCalculates(false);

// you can invalidate the current update to get a new update next time you get state
enhancedDoubleSupplier.invalidate();

Conditional binding:

// we can build EnhancedBooleanSuppliers off the state of this supplier
EnhancedBooleanSupplier binding = enhancedDoubleSupplier.conditionalBindState()
		.greaterThan(10.0)
		.lessThan(20.0)
		.bind();

// or any of the other components
enhancedDoubleSupplier.conditionalBindVelocityRaw()
		.greaterThan(10.0)
		.lessThan(20.0)
		.bind();

Conditional bindings also support greaterThanEqualTo and lessThanEqualTo. They’re capable of pretty complex conditions built around the state of the controller, its worth taking a look at the documentation attached to the system, and other examples which document the use of conditional binding. The system is pretty intuitive and will work if you list your values from smallest to largest, or if you form closed pairs and list those to it.