001/*----------------------------------------------------------------------------*/
002/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
003/* Open Source Software - may be modified and shared by FRC teams. The code   */
004/* must be accompanied by the FIRST BSD license file in the root directory of */
005/* the project.                                                               */
006/*----------------------------------------------------------------------------*/
007
008package edu.wpi.first.wpilibj;
009
010import edu.wpi.first.wpilibj.smartdashboard.SendableBuilder;
011
012
013/**
014 * The base interface for objects that can be sent over the network through network tables.
015 */
016public interface Sendable {
017  /**
018   * Gets the name of this {@link Sendable} object.
019   *
020   * @return Name
021   */
022  String getName();
023
024  /**
025   * Sets the name of this {@link Sendable} object.
026   *
027   * @param name name
028   */
029  void setName(String name);
030
031  /**
032   * Sets both the subsystem name and device name of this {@link Sendable} object.
033   *
034   * @param subsystem subsystem name
035   * @param name device name
036   */
037  default void setName(String subsystem, String name) {
038    setSubsystem(subsystem);
039    setName(name);
040  }
041
042  /**
043   * Gets the subsystem name of this {@link Sendable} object.
044   *
045   * @return Subsystem name
046   */
047  String getSubsystem();
048
049  /**
050   * Sets the subsystem name of this {@link Sendable} object.
051   *
052   * @param subsystem subsystem name
053   */
054  void setSubsystem(String subsystem);
055
056  /**
057   * Initializes this {@link Sendable} object.
058   *
059   * @param builder sendable builder
060   */
061  void initSendable(SendableBuilder builder);
062}