mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
[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:
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user