[wpiutil] Add Java function package (#3570)

The standard Java package is missing BooleanConsumer as well as Float classes.

Update SendableBuilder to use it instead of internal BooleanConsumer
interface.
This commit is contained in:
Peter Johnson
2021-09-15 21:36:11 -07:00
committed by GitHub
parent 40c7645d6e
commit a52bf87b7d
5 changed files with 70 additions and 17 deletions

View File

@@ -4,6 +4,7 @@
package edu.wpi.first.util.sendable;
import edu.wpi.first.util.function.BooleanConsumer;
import java.util.function.BooleanSupplier;
import java.util.function.Consumer;
import java.util.function.DoubleConsumer;
@@ -41,23 +42,6 @@ public interface SendableBuilder {
*/
void setSafeState(Runnable func);
/**
* Represents an operation that accepts a single boolean-valued argument and returns no result.
* This is the primitive type specialization of Consumer for boolean. Unlike most other functional
* interfaces, BooleanConsumer is expected to operate via side-effects.
*
* <p>This is a functional interface whose functional method is accept(boolean).
*/
@FunctionalInterface
interface BooleanConsumer {
/**
* Performs the operation on the given value.
*
* @param value the value
*/
void accept(boolean value);
}
/**
* Add a boolean property.
*