Interface SendableBuilder

All Superinterfaces:
AutoCloseable
All Known Subinterfaces:
NTSendableBuilder
All Known Implementing Classes:
SendableBuilderImpl

public interface SendableBuilder extends AutoCloseable
Helper class for building Sendable dashboard representations.
  • Method Details

    • setSmartDashboardType

      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
    • addBooleanProperty

      Add a boolean property.
      Parameters:
      key - property name
      getter - getter function (returns current value)
      setter - setter function (sets new value)
    • publishConstBoolean

      void publishConstBoolean(String key, boolean value)
      Add a constant boolean property.
      Parameters:
      key - property name
      value - the value
    • addIntegerProperty

      void addIntegerProperty(String key, LongSupplier getter, LongConsumer setter)
      Add an integer property.
      Parameters:
      key - property name
      getter - getter function (returns current value)
      setter - setter function (sets new value)
    • publishConstInteger

      void publishConstInteger(String key, long value)
      Add a constant integer property.
      Parameters:
      key - property name
      value - the value
    • addFloatProperty

      void addFloatProperty(String key, FloatSupplier getter, FloatConsumer setter)
      Add a float property.
      Parameters:
      key - property name
      getter - getter function (returns current value)
      setter - setter function (sets new value)
    • publishConstFloat

      void publishConstFloat(String key, float value)
      Add a constant float property.
      Parameters:
      key - property name
      value - the value
    • addDoubleProperty

      Add a double property.
      Parameters:
      key - property name
      getter - getter function (returns current value)
      setter - setter function (sets new value)
    • publishConstDouble

      void publishConstDouble(String key, double value)
      Add a constant double property.
      Parameters:
      key - property name
      value - the 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)
    • publishConstString

      void publishConstString(String key, String value)
      Add a constant string property.
      Parameters:
      key - property name
      value - the 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)
    • publishConstBooleanArray

      void publishConstBooleanArray(String key, boolean[] value)
      Add a constant boolean array property.
      Parameters:
      key - property name
      value - the value
    • addIntegerArrayProperty

      void addIntegerArrayProperty(String key, Supplier<long[]> getter, Consumer<long[]> setter)
      Add an integer array property.
      Parameters:
      key - property name
      getter - getter function (returns current value)
      setter - setter function (sets new value)
    • publishConstIntegerArray

      void publishConstIntegerArray(String key, long[] value)
      Add a constant integer property.
      Parameters:
      key - property name
      value - the value
    • addFloatArrayProperty

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

      void publishConstFloatArray(String key, float[] value)
      Add a constant float array property.
      Parameters:
      key - property name
      value - the 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)
    • publishConstDoubleArray

      void publishConstDoubleArray(String key, double[] value)
      Add a constant double array property.
      Parameters:
      key - property name
      value - the 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)
    • publishConstStringArray

      void publishConstStringArray(String key, String[] value)
      Add a constant string array property.
      Parameters:
      key - property name
      value - the value
    • addRawProperty

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

      void publishConstRaw(String key, String typeString, byte[] value)
      Add a constant raw property.
      Parameters:
      key - property name
      typeString - type string
      value - the value
    • getBackendKind

      Gets the kind of backend being used.
      Returns:
      Backend kind
    • isPublished

      boolean isPublished()
      Return whether this sendable has been published.
      Returns:
      True if it has been published, false if not.
    • update

      void update()
      Update the published values by calling the getters for all properties.
    • clearProperties

      Clear properties.
    • addCloseable

      void addCloseable(AutoCloseable closeable)
      Adds a closeable. The closeable.close() will be called when close() is called.
      Parameters:
      closeable - closeable object