edu.wpi.first.wpilibj.smartdashboard

## Class SmartDashboard

- java.lang.Object
- - edu.wpi.first.wpilibj.smartdashboard.SmartDashboard

-     public class SmartDashboard
      extends java.lang.Object

  The `SmartDashboard` class is the bridge between robot programs and the SmartDashboard on the laptop.

  When a value is put into the SmartDashboard here, it pops up on the SmartDashboard on the laptop. Users can put values into and get values from the SmartDashboard.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SmartDashboard()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `clearFlags(java.lang.String key, int flags)` Clears flags on the specified key in this table.
    `static void` | `clearPersistent(java.lang.String key)` Stop making a key's value persistent through program restarts.
    `static boolean` | `containsKey(java.lang.String key)` Checks the table and tells if it contains the specified key.
    `static void` | `delete(java.lang.String key)` Deletes the specified key in this table.
    `static boolean` | `getBoolean(java.lang.String key, boolean defaultValue)` Returns the boolean the key maps to.
    `static boolean[]` | `getBooleanArray(java.lang.String key, boolean[] defaultValue)` Returns the boolean array the key maps to.
    `static java.lang.Boolean[]` | `getBooleanArray(java.lang.String key, java.lang.Boolean[] defaultValue)` Returns the boolean array the key maps to.
    `static Sendable` | `getData(java.lang.String key)` Returns the value at the specified key.
    `static NetworkTableEntry` | `getEntry(java.lang.String key)` Gets the entry for the specified key.
    `static int` | `getFlags(java.lang.String key)` Returns the flags for the specified key.
    `static java.util.Set<java.lang.String>` | `getKeys()` Get the keys stored in the SmartDashboard table of NetworkTables.
    `static java.util.Set<java.lang.String>` | `getKeys(int types)` Get the keys stored in the SmartDashboard table of NetworkTables.
    `static double` | `getNumber(java.lang.String key, double defaultValue)` Returns the number the key maps to.
    `static double[]` | `getNumberArray(java.lang.String key, double[] defaultValue)` Returns the number array the key maps to.
    `static java.lang.Double[]` | `getNumberArray(java.lang.String key, java.lang.Double[] defaultValue)` Returns the number array the key maps to.
    `static byte[]` | `getRaw(java.lang.String key, byte[] defaultValue)` Returns the raw value (byte array) the key maps to.
    `static java.lang.String` | `getString(java.lang.String key, java.lang.String defaultValue)` Returns the string the key maps to.
    `static java.lang.String[]` | `getStringArray(java.lang.String key, java.lang.String[] defaultValue)` Returns the string array the key maps to.
    `static boolean` | `isPersistent(java.lang.String key)` Returns whether the value is persistent through program restarts.
    `static boolean` | `putBoolean(java.lang.String key, boolean value)` Put a boolean in the table.
    `static boolean` | `putBooleanArray(java.lang.String key, boolean[] value)` Put a boolean array in the table.
    `static boolean` | `putBooleanArray(java.lang.String key, java.lang.Boolean[] value)` Put a boolean array in the table.
    `static void` | `putData(NamedSendable value)` Maps the specified key (where the key is the name of the `NamedSendable` SmartDashboardNamedData to the specified value in this table.
    `static void` | `putData(java.lang.String key, Sendable data)` Maps the specified key to the specified value in this table.
    `static boolean` | `putNumber(java.lang.String key, double value)` Put a number in the table.
    `static boolean` | `putNumberArray(java.lang.String key, double[] value)` Put a number array in the table.
    `static boolean` | `putNumberArray(java.lang.String key, java.lang.Double[] value)` Put a number array in the table.
    `static boolean` | `putRaw(java.lang.String key, byte[] value)` Put a raw value (byte array) in the table.
    `static boolean` | `putRaw(java.lang.String key, java.nio.ByteBuffer value, int len)` Put a raw value (bytes from a byte buffer) in the table.
    `static boolean` | `putString(java.lang.String key, java.lang.String value)` Put a string in the table.
    `static boolean` | `putStringArray(java.lang.String key, java.lang.String[] value)` Put a string array in the table.
    `static boolean` | `setDefaultBoolean(java.lang.String key, boolean defaultValue)` Gets the current value in the table, setting it if it does not exist.
    `static boolean` | `setDefaultBooleanArray(java.lang.String key, boolean[] defaultValue)` Gets the current value in the table, setting it if it does not exist.
    `static boolean` | `setDefaultBooleanArray(java.lang.String key, java.lang.Boolean[] defaultValue)` Gets the current value in the table, setting it if it does not exist.
    `static boolean` | `setDefaultNumber(java.lang.String key, double defaultValue)` Gets the current value in the table, setting it if it does not exist.
    `static boolean` | `setDefaultNumberArray(java.lang.String key, double[] defaultValue)` Gets the current value in the table, setting it if it does not exist.
    `static boolean` | `setDefaultNumberArray(java.lang.String key, java.lang.Double[] defaultValue)` Gets the current value in the table, setting it if it does not exist.
    `static boolean` | `setDefaultRaw(java.lang.String key, byte[] defaultValue)` Gets the current value in the table, setting it if it does not exist.
    `static boolean` | `setDefaultString(java.lang.String key, java.lang.String defaultValue)` Gets the current value in the table, setting it if it does not exist.
    `static boolean` | `setDefaultStringArray(java.lang.String key, java.lang.String[] defaultValue)` Gets the current value in the table, setting it if it does not exist.
    `static void` | `setFlags(java.lang.String key, int flags)` Sets flags on the specified key in this table.
    `static void` | `setPersistent(java.lang.String key)` Makes a key's value persistent through program restarts.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### SmartDashboard

          public SmartDashboard()

  - ### Method Detail

    - #### putData

          public static void putData(java.lang.String key,
                                     Sendable data)

      Maps the specified key to the specified value in this table. The key can not be null. The value can be retrieved by calling the get method with a key that is equal to the original key.
      Parameters:
        `key` - the key
        `data` - the value
      Throws:
        `java.lang.IllegalArgumentException` - If key is null

    - #### putData

          public static void putData(NamedSendable value)

      Maps the specified key (where the key is the name of the `NamedSendable` SmartDashboardNamedData to the specified value in this table. The value can be retrieved by calling the get method with a key that is equal to the original key.
      Parameters:
        `value` - the value
      Throws:
        `java.lang.IllegalArgumentException` - If key is null

    - #### getData

          public static Sendable getData(java.lang.String key)

      Returns the value at the specified key.
      Parameters:
        `key` - the key
      Returns:
        the value
      Throws:
        `java.lang.IllegalArgumentException` - if the key is null

    - #### getEntry

          public static NetworkTableEntry getEntry(java.lang.String key)

      Gets the entry for the specified key.
      Parameters:
        `key` - the key name
      Returns:
        Network table entry.

    - #### containsKey

          public static boolean containsKey(java.lang.String key)

      Checks the table and tells if it contains the specified key.
      Parameters:
        `key` - the key to search for
      Returns:
        true if the table as a value assigned to the given key

    - #### getKeys

          public static java.util.Set<java.lang.String> getKeys(int types)

      Get the keys stored in the SmartDashboard table of NetworkTables.
      Parameters:
        `types` - bitmask of types; 0 is treated as a "don't care".
      Returns:
        keys currently in the table

    - #### getKeys

          public static java.util.Set<java.lang.String> getKeys()

      Get the keys stored in the SmartDashboard table of NetworkTables.
      Returns:
        keys currently in the table.

    - #### setPersistent

          public static void setPersistent(java.lang.String key)

      Makes a key's value persistent through program restarts. The key cannot be null.
      Parameters:
        `key` - the key name

    - #### clearPersistent

          public static void clearPersistent(java.lang.String key)

      Stop making a key's value persistent through program restarts. The key cannot be null.
      Parameters:
        `key` - the key name

    - #### isPersistent

          public static boolean isPersistent(java.lang.String key)

      Returns whether the value is persistent through program restarts. The key cannot be null.
      Parameters:
        `key` - the key name
      Returns:
        True if the value is persistent.

    - #### setFlags

          public static void setFlags(java.lang.String key,
                                      int flags)

      Sets flags on the specified key in this table. The key can not be null.
      Parameters:
        `key` - the key name
        `flags` - the flags to set (bitmask)

    - #### clearFlags

          public static void clearFlags(java.lang.String key,
                                        int flags)

      Clears flags on the specified key in this table. The key can not be null.
      Parameters:
        `key` - the key name
        `flags` - the flags to clear (bitmask)

    - #### getFlags

          public static int getFlags(java.lang.String key)

      Returns the flags for the specified key.
      Parameters:
        `key` - the key name
      Returns:
        the flags, or 0 if the key is not defined

    - #### delete

          public static void delete(java.lang.String key)

      Deletes the specified key in this table. The key can not be null.
      Parameters:
        `key` - the key name

    - #### putBoolean

          public static boolean putBoolean(java.lang.String key,
                                           boolean value)

      Put a boolean in the table.
      Parameters:
        `key` - the key to be assigned to
        `value` - the value that will be assigned
      Returns:
        False if the table key already exists with a different type

    - #### setDefaultBoolean

          public static boolean setDefaultBoolean(java.lang.String key,
                                                  boolean defaultValue)

      Gets the current value in the table, setting it if it does not exist.
      Parameters:
        `key` - the key
        `defaultValue` - the default value to set if key does not exist.
      Returns:
        False if the table key exists with a different type

    - #### getBoolean

          public static boolean getBoolean(java.lang.String key,
                                           boolean defaultValue)

      Returns the boolean the key maps to. If the key does not exist or is of different type, it will return the default value.
      Parameters:
        `key` - the key to look up
        `defaultValue` - the value to be returned if no value is found
      Returns:
        the value associated with the given key or the given default value if there is no value associated with the key

    - #### putNumber

          public static boolean putNumber(java.lang.String key,
                                          double value)

      Put a number in the table.
      Parameters:
        `key` - the key to be assigned to
        `value` - the value that will be assigned
      Returns:
        False if the table key already exists with a different type

    - #### setDefaultNumber

          public static boolean setDefaultNumber(java.lang.String key,
                                                 double defaultValue)

      Gets the current value in the table, setting it if it does not exist.
      Parameters:
        `key` - the key
        `defaultValue` - the default value to set if key does not exist.
      Returns:
        False if the table key exists with a different type

    - #### getNumber

          public static double getNumber(java.lang.String key,
                                         double defaultValue)

      Returns the number the key maps to. If the key does not exist or is of different type, it will return the default value.
      Parameters:
        `key` - the key to look up
        `defaultValue` - the value to be returned if no value is found
      Returns:
        the value associated with the given key or the given default value if there is no value associated with the key

    - #### putString

          public static boolean putString(java.lang.String key,
                                          java.lang.String value)

      Put a string in the table.
      Parameters:
        `key` - the key to be assigned to
        `value` - the value that will be assigned
      Returns:
        False if the table key already exists with a different type

    - #### setDefaultString

          public static boolean setDefaultString(java.lang.String key,
                                                 java.lang.String defaultValue)

      Gets the current value in the table, setting it if it does not exist.
      Parameters:
        `key` - the key
        `defaultValue` - the default value to set if key does not exist.
      Returns:
        False if the table key exists with a different type

    - #### getString

          public static java.lang.String getString(java.lang.String key,
                                                   java.lang.String defaultValue)

      Returns the string the key maps to. If the key does not exist or is of different type, it will return the default value.
      Parameters:
        `key` - the key to look up
        `defaultValue` - the value to be returned if no value is found
      Returns:
        the value associated with the given key or the given default value if there is no value associated with the key

    - #### putBooleanArray

          public static boolean putBooleanArray(java.lang.String key,
                                                boolean[] value)

      Put a boolean array in the table.
      Parameters:
        `key` - the key to be assigned to
        `value` - the value that will be assigned
      Returns:
        False if the table key already exists with a different type

    - #### putBooleanArray

          public static boolean putBooleanArray(java.lang.String key,
                                                java.lang.Boolean[] value)

      Put a boolean array in the table.
      Parameters:
        `key` - the key to be assigned to
        `value` - the value that will be assigned
      Returns:
        False if the table key already exists with a different type

    - #### setDefaultBooleanArray

          public static boolean setDefaultBooleanArray(java.lang.String key,
                                                       boolean[] defaultValue)

      Gets the current value in the table, setting it if it does not exist.
      Parameters:
        `key` - the key
        `defaultValue` - the default value to set if key does not exist.
      Returns:
        False if the table key exists with a different type

    - #### setDefaultBooleanArray

          public static boolean setDefaultBooleanArray(java.lang.String key,
                                                       java.lang.Boolean[] defaultValue)

      Gets the current value in the table, setting it if it does not exist.
      Parameters:
        `key` - the key
        `defaultValue` - the default value to set if key does not exist.
      Returns:
        False if the table key exists with a different type

    - #### getBooleanArray

          public static boolean[] getBooleanArray(java.lang.String key,
                                                  boolean[] defaultValue)

      Returns the boolean array the key maps to. If the key does not exist or is of different type, it will return the default value.
      Parameters:
        `key` - the key to look up
        `defaultValue` - the value to be returned if no value is found
      Returns:
        the value associated with the given key or the given default value if there is no value associated with the key

    - #### getBooleanArray

          public static java.lang.Boolean[] getBooleanArray(java.lang.String key,
                                                            java.lang.Boolean[] defaultValue)

      Returns the boolean array the key maps to. If the key does not exist or is of different type, it will return the default value.
      Parameters:
        `key` - the key to look up
        `defaultValue` - the value to be returned if no value is found
      Returns:
        the value associated with the given key or the given default value if there is no value associated with the key

    - #### putNumberArray

          public static boolean putNumberArray(java.lang.String key,
                                               double[] value)

      Put a number array in the table.
      Parameters:
        `key` - the key to be assigned to
        `value` - the value that will be assigned
      Returns:
        False if the table key already exists with a different type

    - #### putNumberArray

          public static boolean putNumberArray(java.lang.String key,
                                               java.lang.Double[] value)

      Put a number array in the table.
      Parameters:
        `key` - the key to be assigned to
        `value` - the value that will be assigned
      Returns:
        False if the table key already exists with a different type

    - #### setDefaultNumberArray

          public static boolean setDefaultNumberArray(java.lang.String key,
                                                      double[] defaultValue)

      Gets the current value in the table, setting it if it does not exist.
      Parameters:
        `key` - the key
        `defaultValue` - the default value to set if key does not exist.
      Returns:
        False if the table key exists with a different type

    - #### setDefaultNumberArray

          public static boolean setDefaultNumberArray(java.lang.String key,
                                                      java.lang.Double[] defaultValue)

      Gets the current value in the table, setting it if it does not exist.
      Parameters:
        `key` - the key
        `defaultValue` - the default value to set if key does not exist.
      Returns:
        False if the table key exists with a different type

    - #### getNumberArray

          public static double[] getNumberArray(java.lang.String key,
                                                double[] defaultValue)

      Returns the number array the key maps to. If the key does not exist or is of different type, it will return the default value.
      Parameters:
        `key` - the key to look up
        `defaultValue` - the value to be returned if no value is found
      Returns:
        the value associated with the given key or the given default value if there is no value associated with the key

    - #### getNumberArray

          public static java.lang.Double[] getNumberArray(java.lang.String key,
                                                          java.lang.Double[] defaultValue)

      Returns the number array the key maps to. If the key does not exist or is of different type, it will return the default value.
      Parameters:
        `key` - the key to look up
        `defaultValue` - the value to be returned if no value is found
      Returns:
        the value associated with the given key or the given default value if there is no value associated with the key

    - #### putStringArray

          public static boolean putStringArray(java.lang.String key,
                                               java.lang.String[] value)

      Put a string array in the table.
      Parameters:
        `key` - the key to be assigned to
        `value` - the value that will be assigned
      Returns:
        False if the table key already exists with a different type

    - #### setDefaultStringArray

          public static boolean setDefaultStringArray(java.lang.String key,
                                                      java.lang.String[] defaultValue)

      Gets the current value in the table, setting it if it does not exist.
      Parameters:
        `key` - the key
        `defaultValue` - the default value to set if key does not exist.
      Returns:
        False if the table key exists with a different type

    - #### getStringArray

          public static java.lang.String[] getStringArray(java.lang.String key,
                                                          java.lang.String[] defaultValue)

      Returns the string array the key maps to. If the key does not exist or is of different type, it will return the default value.
      Parameters:
        `key` - the key to look up
        `defaultValue` - the value to be returned if no value is found
      Returns:
        the value associated with the given key or the given default value if there is no value associated with the key

    - #### putRaw

          public static boolean putRaw(java.lang.String key,
                                       byte[] value)

      Put a raw value (byte array) in the table.
      Parameters:
        `key` - the key to be assigned to
        `value` - the value that will be assigned
      Returns:
        False if the table key already exists with a different type

    - #### putRaw

          public static boolean putRaw(java.lang.String key,
                                       java.nio.ByteBuffer value,
                                       int len)

      Put a raw value (bytes from a byte buffer) in the table.
      Parameters:
        `key` - the key to be assigned to
        `value` - the value that will be assigned
        `len` - the length of the value
      Returns:
        False if the table key already exists with a different type

    - #### setDefaultRaw

          public static boolean setDefaultRaw(java.lang.String key,
                                              byte[] defaultValue)

      Gets the current value in the table, setting it if it does not exist.
      Parameters:
        `key` - the key
        `defaultValue` - the default value to set if key does not exist.
      Returns:
        False if the table key exists with a different type

    - #### getRaw

          public static byte[] getRaw(java.lang.String key,
                                      byte[] defaultValue)

      Returns the raw value (byte array) the key maps to. If the key does not exist or is of different type, it will return the default value.
      Parameters:
        `key` - the key to look up
        `defaultValue` - the value to be returned if no value is found
      Returns:
        the value associated with the given key or the given default value if there is no value associated with the key