Interface StructPublisher<T>

Type Parameters:
T - value class
All Superinterfaces:
AutoCloseable, Consumer<T>, Publisher, PubSub
All Known Subinterfaces:
StructEntry<T>

public interface StructPublisher<T>
extends Publisher, Consumer<T>
NetworkTables struct-encoded value publisher.
  • Method Summary

    Modifier and Type Method Description
    default void accept​(T value)  
    StructTopic<T> getTopic()
    Get the corresponding topic.
    default void set​(T value)
    Publish a new value using current NT time.
    void set​(T value, long time)
    Publish a new value.
    void setDefault​(T value)
    Publish a default value.

    Methods inherited from interface java.util.function.Consumer

    andThen

    Methods inherited from interface edu.wpi.first.networktables.PubSub

    close, getHandle, isValid
  • Method Details

    • getTopic

      Get the corresponding topic.
      Specified by:
      getTopic in interface PubSub
      Returns:
      Topic
    • set

      default void set​(T value)
      Publish a new value using current NT time.
      Parameters:
      value - value to publish
    • set

      void set​(T value, long time)
      Publish a new value.
      Parameters:
      value - value to publish
      time - timestamp; 0 indicates current NT time should be used
    • setDefault

      void setDefault​(T value)
      Publish a default value. On reconnect, a default value will never be used in preference to a published value.
      Parameters:
      value - value
    • accept

      default void accept​(T value)
      Specified by:
      accept in interface Consumer<T>