CrossTheRoadElec / Phoenix-Releases

Release repository for Phoenix-Framework and Phoenix-Tuner
76 stars 7 forks source link

Add static factory sugar for Java control requests #45

Open Oblarg opened 11 months ago

Oblarg commented 11 months ago

Instead of forcing users to manually call constructors with new, static factories wrapping the different control request types would improve readability:

motor.setControl(dutyCycle(1.0));

// compare to:
motor.setControl(new DutyCycleOut(1.0));

Implementation and maintenance cost for the static factories should be basically zero.