Package edu.wpi.first.util.sendable
Interface SendableBuilder
- All Known Subinterfaces:
- NTSendableBuilder
- All Known Implementing Classes:
- SendableBuilderImpl
public interface SendableBuilder
- 
Nested Class SummaryNested Classes Modifier and Type Interface Description static classSendableBuilder.BackendKindThe backend kinds used for the sendable builder.
- 
Method SummaryModifier and Type Method Description voidaddBooleanArrayProperty(String key, Supplier<boolean[]> getter, Consumer<boolean[]> setter)Add a boolean array property.voidaddBooleanProperty(String key, BooleanSupplier getter, BooleanConsumer setter)Add a boolean property.voidaddDoubleArrayProperty(String key, Supplier<double[]> getter, Consumer<double[]> setter)Add a double array property.voidaddDoubleProperty(String key, DoubleSupplier getter, DoubleConsumer setter)Add a double property.voidaddRawProperty(String key, Supplier<byte[]> getter, Consumer<byte[]> setter)Add a raw property.voidaddStringArrayProperty(String key, Supplier<String[]> getter, Consumer<String[]> setter)Add a string array property.voidaddStringProperty(String key, Supplier<String> getter, Consumer<String> setter)Add a string property.voidclearProperties()Clear properties.SendableBuilder.BackendKindgetBackendKind()Gets the kind of backend being used.booleanisPublished()Return whether this sendable has been published.voidsetActuator(boolean value)Set a flag indicating if this sendable should be treated as an actuator.voidsetSafeState(Runnable func)Set the function that should be called to set the Sendable into a safe state.voidsetSmartDashboardType(String type)Set the string representation of the named data type that will be used by the smart dashboard for this sendable.voidupdate()Update the published values by calling the getters for all properties.
- 
Method Details- 
setSmartDashboardTypeSet the string representation of the named data type that will be used by the smart dashboard for this sendable.- Parameters:
- type- data type
 
- 
setActuatorSet a flag indicating if this sendable should be treated as an actuator. By default this flag is false.- Parameters:
- value- true if actuator, false if not
 
- 
setSafeStateSet the function that should be called to set the Sendable into a safe state. This is called when entering and exiting Live Window mode.- Parameters:
- func- function
 
- 
addBooleanPropertyAdd a boolean property.- Parameters:
- key- property name
- getter- getter function (returns current value)
- setter- setter function (sets new value)
 
- 
addDoublePropertyAdd a double property.- Parameters:
- key- property name
- getter- getter function (returns current value)
- setter- setter function (sets new value)
 
- 
addStringPropertyAdd a string property.- Parameters:
- key- property name
- getter- getter function (returns current value)
- setter- setter function (sets new value)
 
- 
addBooleanArrayPropertyAdd a boolean array property.- Parameters:
- key- property name
- getter- getter function (returns current value)
- setter- setter function (sets new value)
 
- 
addDoubleArrayPropertyAdd a double array property.- Parameters:
- key- property name
- getter- getter function (returns current value)
- setter- setter function (sets new value)
 
- 
addStringArrayPropertyAdd a string array property.- Parameters:
- key- property name
- getter- getter function (returns current value)
- setter- setter function (sets new value)
 
- 
addRawPropertyAdd a raw property.- Parameters:
- key- property name
- getter- getter function (returns current value)
- setter- setter function (sets new value)
 
- 
getBackendKindGets the kind of backend being used.- Returns:
- Backend kind
 
- 
isPublishedboolean isPublished()Return whether this sendable has been published.- Returns:
- True if it has been published, false if not.
 
- 
updatevoid update()Update the published values by calling the getters for all properties.
- 
clearPropertiesvoid clearProperties()Clear properties.
 
-