Class SmartString

java.lang.Object
com.stuypulse.stuylib.network.SmartString
All Implemented Interfaces:
Supplier<String>

public final class SmartString extends Object implements Supplier<String>
SmartString works as a wrapper for values on SmartDashboard. The idea for this class was to make getting values on SmartDashboard easier by making them variables that you know were initialized.
  • Constructor Details

    • SmartString

      public SmartString(String id, String value)
      Creates a SmartString with the element name and a default value. The value on SmartDashboard will be reset to the default value on initialization.
      Parameters:
      id - the name of the String on SmartDashboard
      value - the default / initialization value for the value
  • Method Details

    • get

      public String get()
      Specified by:
      get in interface Supplier<String>
      Returns:
      the value of the String from SmartDashboard
    • getDefault

      public String getDefault()
      Returns:
      the default value of the String
    • set

      public void set(String value)
      Parameters:
      value - what the value on SmartDashboard will be set to
    • reset

      public void reset()
      Resets the value on SmartDashboard to the default value