Class LoggedNetworkString

java.lang.Object
org.littletonrobotics.junction.networktables.LoggedNetworkInput
org.littletonrobotics.junction.networktables.LoggedNetworkString
All Implemented Interfaces:
Supplier<String>

public class LoggedNetworkString extends LoggedNetworkInput implements Supplier<String>
Manages a String value published to the root table of NT.
  • Constructor Details

    • LoggedNetworkString

      public LoggedNetworkString(String key)
      Creates a new LoggedNetworkString, for handling a string input sent via NetworkTables.
      Parameters:
      key - The key for the number, published to the root table of NT or "/DashboardInputs/{key}" when logged.
    • LoggedNetworkString

      public LoggedNetworkString(String key, String defaultValue)
      Creates a new LoggedNetworkString, for handling a string input sent via NetworkTables.
      Parameters:
      key - The key for the number, published to the root table of NT or "/DashboardInputs/{key}" when logged.
      defaultValue - The default value if no value in NT is found.
  • Method Details

    • setDefault

      public void setDefault(String defaultValue)
      Updates the default value, which is used if no value in NT is found.
      Parameters:
      defaultValue - The new default value.
    • set

      public void set(String value)
      Publishes a new value. Note that the value will not be returned by get() until the next cycle.
      Parameters:
      value - The new value.
    • get

      public String get()
      Returns the current value.
      Specified by:
      get in interface Supplier<String>
      Returns:
      The current value.
    • periodic

      public void periodic()
      Description copied from class: LoggedNetworkInput
      Update the current value and save/replay the input. This function should never be called by user code.
      Specified by:
      periodic in class LoggedNetworkInput