Class Param<T>

java.lang.Object
frc.spectrumLib.params.Param<T>
Type Parameters:
T - the value type
Direct Known Subclasses:
BooleanParam, DoubleParam, IntParam, StringParam

public abstract sealed class Param<T> extends Object permits DoubleParam, IntParam, BooleanParam, StringParam
One tunable value, declared in code with a name, type, default, units and optional bounds, and resolved from the layers described in Params. Declare params through a ParamGroup. Read and change them on the main thread only.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    The value types a params file and the transport can carry.
  • Method Summary

    Modifier and Type
    Method
    Description
    get()
    The current value.
    The default in the declaration.
     
    key()
     
    double
    max()
    Upper bound, or NaN when the type has none.
    double
    min()
    Lower bound, or NaN when the type has none.
    group/key, the name used in logs, NT and messages.
    Which layer the current value came from.
    abstract Param.Type
     
     
    int
    Goes up by one each time the value changes, for code that must act on a change (re-sending a setting to a device, say): keep the last version seen and compare.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • get

      public T get()
      The current value.
    • getDefault

      public T getDefault()
      The default in the declaration.
    • group

      public String group()
    • key

      public String key()
    • path

      public String path()
      group/key, the name used in logs, NT and messages.
    • units

      public String units()
    • source

      public ParamSource source()
      Which layer the current value came from.
    • version

      public int version()
      Goes up by one each time the value changes, for code that must act on a change (re-sending a setting to a device, say): keep the last version seen and compare.
    • type

      public abstract Param.Type type()
    • min

      public double min()
      Lower bound, or NaN when the type has none.
    • max

      public double max()
      Upper bound, or NaN when the type has none.