Class SmartBoolean

java.lang.Object
com.stuypulse.stuylib.network.SmartBoolean
All Implemented Interfaces:
BStream, BooleanSupplier

public final class SmartBoolean extends Object implements BStream
SmartBoolean 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

    • SmartBoolean

      public SmartBoolean(String id, boolean value)
      Creates a SmartBoolean 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 boolean on SmartDashboard
      value - the default / initialization value for the value
  • Method Details

    • get

      public boolean get()
      Specified by:
      get in interface BStream
      Returns:
      the value of the boolean from SmartDashboard
    • getDefault

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

      public void set(boolean 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