Interface SendableBuilder

All Known Implementing Classes:
SendableBuilderImpl

public interface SendableBuilder
  • Method Details

    • getTable

      NetworkTable getTable()
      Get the network table.
      Returns:
      The network table
    • setSmartDashboardType

      void setSmartDashboardType​(String type)
      Set the string representation of the named data type that will be used by the smart dashboard for this sendable.
      Parameters:
      type - data type
    • setActuator

      void setActuator​(boolean value)
      Set 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
    • setSafeState

      void setSafeState​(Runnable func)
      Set 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
    • setUpdateTable

      void setUpdateTable​(Runnable func)
      Set the function that should be called to update the network table for things other than properties. Note this function is not passed the network table object; instead it should use the entry handles returned by getEntry().
      Parameters:
      func - function
    • getEntry

      NetworkTableEntry getEntry​(String key)
      Add a property without getters or setters. This can be used to get entry handles for the function called by setUpdateTable().
      Parameters:
      key - property name
      Returns:
      Network table entry
    • addBooleanProperty

      void addBooleanProperty​(String key, BooleanSupplier getter, SendableBuilder.BooleanConsumer setter)
      Add a boolean property.
      Parameters:
      key - property name
      getter - getter function (returns current value)
      setter - setter function (sets new value)
    • addDoubleProperty

      void addDoubleProperty​(String key, DoubleSupplier getter, DoubleConsumer setter)
      Add a double property.
      Parameters:
      key - property name
      getter - getter function (returns current value)
      setter - setter function (sets new value)
    • addStringProperty

      void addStringProperty​(String key, Supplier<String> getter, Consumer<String> setter)
      Add a string property.
      Parameters:
      key - property name
      getter - getter function (returns current value)
      setter - setter function (sets new value)
    • addBooleanArrayProperty

      void addBooleanArrayProperty​(String key, Supplier<boolean[]> getter, Consumer<boolean[]> setter)
      Add a boolean array property.
      Parameters:
      key - property name
      getter - getter function (returns current value)
      setter - setter function (sets new value)
    • addDoubleArrayProperty

      void addDoubleArrayProperty​(String key, Supplier<double[]> getter, Consumer<double[]> setter)
      Add a double array property.
      Parameters:
      key - property name
      getter - getter function (returns current value)
      setter - setter function (sets new value)
    • addStringArrayProperty

      void addStringArrayProperty​(String key, Supplier<String[]> getter, Consumer<String[]> setter)
      Add a string array property.
      Parameters:
      key - property name
      getter - getter function (returns current value)
      setter - setter function (sets new value)
    • addRawProperty

      void addRawProperty​(String key, Supplier<byte[]> getter, Consumer<byte[]> setter)
      Add a raw property.
      Parameters:
      key - property name
      getter - getter function (returns current value)
      setter - setter function (sets new value)
    • addValueProperty

      void addValueProperty​(String key, Supplier<NetworkTableValue> getter, Consumer<NetworkTableValue> setter)
      Add a NetworkTableValue property.
      Parameters:
      key - property name
      getter - getter function (returns current value)
      setter - setter function (sets new value)