public class SendableBuilderImpl extends java.lang.Object implements SendableBuilder
SendableBuilder.BooleanConsumer
Constructor and Description |
---|
SendableBuilderImpl() |
Modifier and Type | Method and Description |
---|---|
void |
addBooleanArrayProperty(java.lang.String key,
java.util.function.Supplier<boolean[]> getter,
java.util.function.Consumer<boolean[]> setter)
Add a boolean array property.
|
void |
addBooleanProperty(java.lang.String key,
java.util.function.BooleanSupplier getter,
SendableBuilder.BooleanConsumer setter)
Add a boolean property.
|
void |
addDoubleArrayProperty(java.lang.String key,
java.util.function.Supplier<double[]> getter,
java.util.function.Consumer<double[]> setter)
Add a double array property.
|
void |
addDoubleProperty(java.lang.String key,
java.util.function.DoubleSupplier getter,
java.util.function.DoubleConsumer setter)
Add a double property.
|
void |
addRawProperty(java.lang.String key,
java.util.function.Supplier<byte[]> getter,
java.util.function.Consumer<byte[]> setter)
Add a raw property.
|
void |
addStringArrayProperty(java.lang.String key,
java.util.function.Supplier<java.lang.String[]> getter,
java.util.function.Consumer<java.lang.String[]> setter)
Add a string array property.
|
void |
addStringProperty(java.lang.String key,
java.util.function.Supplier<java.lang.String> getter,
java.util.function.Consumer<java.lang.String> setter)
Add a string property.
|
void |
addValueProperty(java.lang.String key,
java.util.function.Supplier<NetworkTableValue> getter,
java.util.function.Consumer<NetworkTableValue> setter)
Add a NetworkTableValue property.
|
NetworkTableEntry |
getEntry(java.lang.String key)
Add a property without getters or setters.
|
NetworkTable |
getTable()
Get the network table.
|
void |
setSafeState(java.lang.Runnable func)
Set the function that should be called to set the Sendable into a safe
state.
|
void |
setSmartDashboardType(java.lang.String type)
Set the string representation of the named data type that will be used
by the smart dashboard for this sendable.
|
void |
setTable(NetworkTable table)
Set the network table.
|
void |
setUpdateTable(java.lang.Runnable func)
Set the function that should be called to update the network table
for things other than properties.
|
void |
startListeners()
Hook setters for all properties.
|
void |
startLiveWindowMode()
Start LiveWindow mode by hooking the setters for all properties.
|
void |
stopListeners()
Unhook setters for all properties.
|
void |
stopLiveWindowMode()
Stop LiveWindow mode by unhooking the setters for all properties.
|
void |
updateTable()
Update the network table values by calling the getters for all properties.
|
public SendableBuilderImpl()
public void setTable(NetworkTable table)
table
- Network tablepublic NetworkTable getTable()
public void updateTable()
public void startListeners()
public void stopListeners()
public void startLiveWindowMode()
public void stopLiveWindowMode()
public void setSmartDashboardType(java.lang.String type)
setSmartDashboardType
in interface SendableBuilder
type
- data typepublic void setSafeState(java.lang.Runnable func)
setSafeState
in interface SendableBuilder
func
- functionpublic void setUpdateTable(java.lang.Runnable func)
setUpdateTable
in interface SendableBuilder
func
- functionpublic NetworkTableEntry getEntry(java.lang.String key)
getEntry
in interface SendableBuilder
key
- property namepublic void addBooleanProperty(java.lang.String key, java.util.function.BooleanSupplier getter, SendableBuilder.BooleanConsumer setter)
addBooleanProperty
in interface SendableBuilder
key
- property namegetter
- getter function (returns current value)setter
- setter function (sets new value)public void addDoubleProperty(java.lang.String key, java.util.function.DoubleSupplier getter, java.util.function.DoubleConsumer setter)
addDoubleProperty
in interface SendableBuilder
key
- property namegetter
- getter function (returns current value)setter
- setter function (sets new value)public void addStringProperty(java.lang.String key, java.util.function.Supplier<java.lang.String> getter, java.util.function.Consumer<java.lang.String> setter)
addStringProperty
in interface SendableBuilder
key
- property namegetter
- getter function (returns current value)setter
- setter function (sets new value)public void addBooleanArrayProperty(java.lang.String key, java.util.function.Supplier<boolean[]> getter, java.util.function.Consumer<boolean[]> setter)
addBooleanArrayProperty
in interface SendableBuilder
key
- property namegetter
- getter function (returns current value)setter
- setter function (sets new value)public void addDoubleArrayProperty(java.lang.String key, java.util.function.Supplier<double[]> getter, java.util.function.Consumer<double[]> setter)
addDoubleArrayProperty
in interface SendableBuilder
key
- property namegetter
- getter function (returns current value)setter
- setter function (sets new value)public void addStringArrayProperty(java.lang.String key, java.util.function.Supplier<java.lang.String[]> getter, java.util.function.Consumer<java.lang.String[]> setter)
addStringArrayProperty
in interface SendableBuilder
key
- property namegetter
- getter function (returns current value)setter
- setter function (sets new value)public void addRawProperty(java.lang.String key, java.util.function.Supplier<byte[]> getter, java.util.function.Consumer<byte[]> setter)
addRawProperty
in interface SendableBuilder
key
- property namegetter
- getter function (returns current value)setter
- setter function (sets new value)public void addValueProperty(java.lang.String key, java.util.function.Supplier<NetworkTableValue> getter, java.util.function.Consumer<NetworkTableValue> setter)
addValueProperty
in interface SendableBuilder
key
- property namegetter
- getter function (returns current value)setter
- setter function (sets new value)