Interface GenericPublisher

All Superinterfaces:
AutoCloseable, Consumer<NetworkTableValue>, Publisher, PubSub
All Known Subinterfaces:
GenericEntry

public interface GenericPublisher
extends Publisher, Consumer<NetworkTableValue>
NetworkTables generic publisher.
  • Method Details

    • getTopic

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

      boolean set​(NetworkTableValue value)
      Publish a new value.
      Parameters:
      value - value to publish
      Returns:
      False if the topic already exists with a different type
    • setValue

      default boolean setValue​(Object value)
      Publish a new value.
      Parameters:
      value - value to publish
      Returns:
      False if the topic already exists with a different type
      Throws:
      IllegalArgumentException - if the value is not a known type
    • setValue

      boolean setValue​(Object value, long time)
      Publish a new value.
      Parameters:
      value - value to publish
      time - timestamp; 0 indicates current NT time should be used
      Returns:
      False if the topic already exists with a different type
      Throws:
      IllegalArgumentException - if the value is not a known type
    • setBoolean

      default boolean setBoolean​(boolean value)
      Publish a new value.
      Parameters:
      value - value to publish
      Returns:
      False if the topic already exists with a different type
    • setBoolean

      boolean setBoolean​(boolean value, long time)
      Publish a new value.
      Parameters:
      value - value to publish
      time - timestamp; 0 indicates current NT time should be used
      Returns:
      False if the topic already exists with a different type
    • setInteger

      default boolean setInteger​(long value)
      Publish a new value.
      Parameters:
      value - value to publish
      Returns:
      False if the topic already exists with a different type
    • setInteger

      boolean setInteger​(long value, long time)
      Publish a new value.
      Parameters:
      value - value to publish
      time - timestamp; 0 indicates current NT time should be used
      Returns:
      False if the topic already exists with a different type
    • setFloat

      default boolean setFloat​(float value)
      Publish a new value.
      Parameters:
      value - value to publish
      Returns:
      False if the topic already exists with a different type
    • setFloat

      boolean setFloat​(float value, long time)
      Publish a new value.
      Parameters:
      value - value to publish
      time - timestamp; 0 indicates current NT time should be used
      Returns:
      False if the topic already exists with a different type
    • setDouble

      default boolean setDouble​(double value)
      Publish a new value.
      Parameters:
      value - value to publish
      Returns:
      False if the topic already exists with a different type
    • setDouble

      boolean setDouble​(double value, long time)
      Publish a new value.
      Parameters:
      value - value to publish
      time - timestamp; 0 indicates current NT time should be used
      Returns:
      False if the topic already exists with a different type
    • setString

      default boolean setString​(String value)
      Publish a new value.
      Parameters:
      value - value to publish
      Returns:
      False if the topic already exists with a different type
    • setString

      boolean setString​(String value, long time)
      Publish a new value.
      Parameters:
      value - value to publish
      time - timestamp; 0 indicates current NT time should be used
      Returns:
      False if the topic already exists with a different type
    • setRaw

      default boolean setRaw​(byte[] value)
      Publish a new value.
      Parameters:
      value - value to publish
      Returns:
      False if the topic already exists with a different type
    • setRaw

      boolean setRaw​(byte[] value, long time)
      Publish a new value.
      Parameters:
      value - value to publish
      time - timestamp; 0 indicates current NT time should be used
      Returns:
      False if the topic already exists with a different type
    • setBooleanArray

      default boolean setBooleanArray​(boolean[] value)
      Publish a new value.
      Parameters:
      value - value to publish
      Returns:
      False if the topic already exists with a different type
    • setBooleanArray

      boolean setBooleanArray​(boolean[] value, long time)
      Publish a new value.
      Parameters:
      value - value to publish
      time - timestamp; 0 indicates current NT time should be used
      Returns:
      False if the topic already exists with a different type
    • setBooleanArray

      default boolean setBooleanArray​(Boolean[] value)
      Publish a new value.
      Parameters:
      value - value to publish
      Returns:
      False if the topic already exists with a different type
    • setBooleanArray

      boolean setBooleanArray​(Boolean[] value, long time)
      Publish a new value.
      Parameters:
      value - value to publish
      time - timestamp; 0 indicates current NT time should be used
      Returns:
      False if the topic already exists with a different type
    • setIntegerArray

      default boolean setIntegerArray​(long[] value)
      Publish a new value.
      Parameters:
      value - value to publish
      Returns:
      False if the topic already exists with a different type
    • setIntegerArray

      boolean setIntegerArray​(long[] value, long time)
      Publish a new value.
      Parameters:
      value - value to publish
      time - timestamp; 0 indicates current NT time should be used
      Returns:
      False if the topic already exists with a different type
    • setIntegerArray

      default boolean setIntegerArray​(Long[] value)
      Publish a new value.
      Parameters:
      value - value to publish
      Returns:
      False if the topic already exists with a different type
    • setIntegerArray

      boolean setIntegerArray​(Long[] value, long time)
      Publish a new value.
      Parameters:
      value - value to publish
      time - timestamp; 0 indicates current NT time should be used
      Returns:
      False if the topic already exists with a different type
    • setFloatArray

      default boolean setFloatArray​(float[] value)
      Publish a new value.
      Parameters:
      value - value to publish
      Returns:
      False if the topic already exists with a different type
    • setFloatArray

      boolean setFloatArray​(float[] value, long time)
      Publish a new value.
      Parameters:
      value - value to publish
      time - timestamp; 0 indicates current NT time should be used
      Returns:
      False if the topic already exists with a different type
    • setFloatArray

      default boolean setFloatArray​(Float[] value)
      Publish a new value.
      Parameters:
      value - value to publish
      Returns:
      False if the topic already exists with a different type
    • setFloatArray

      boolean setFloatArray​(Float[] value, long time)
      Publish a new value.
      Parameters:
      value - value to publish
      time - timestamp; 0 indicates current NT time should be used
      Returns:
      False if the topic already exists with a different type
    • setDoubleArray

      default boolean setDoubleArray​(double[] value)
      Publish a new value.
      Parameters:
      value - value to publish
      Returns:
      False if the topic already exists with a different type
    • setDoubleArray

      boolean setDoubleArray​(double[] value, long time)
      Publish a new value.
      Parameters:
      value - value to publish
      time - timestamp; 0 indicates current NT time should be used
      Returns:
      False if the topic already exists with a different type
    • setDoubleArray

      default boolean setDoubleArray​(Double[] value)
      Publish a new value.
      Parameters:
      value - value to publish
      Returns:
      False if the topic already exists with a different type
    • setDoubleArray

      boolean setDoubleArray​(Double[] value, long time)
      Publish a new value.
      Parameters:
      value - value to publish
      time - timestamp; 0 indicates current NT time should be used
      Returns:
      False if the topic already exists with a different type
    • setStringArray

      default boolean setStringArray​(String[] value)
      Publish a new value.
      Parameters:
      value - value to publish
      Returns:
      False if the topic already exists with a different type
    • setStringArray

      boolean setStringArray​(String[] value, long time)
      Publish a new value.
      Parameters:
      value - value to publish
      time - timestamp; 0 indicates current NT time should be used
      Returns:
      False if the topic already exists with a different type
    • setDefault

      boolean setDefault​(NetworkTableValue defaultValue)
      Sets the entry's value if it does not exist.
      Parameters:
      defaultValue - the default value to set
      Returns:
      False if the entry exists with a different type
    • setDefaultValue

      boolean setDefaultValue​(Object defaultValue)
      Sets the entry's value if it does not exist.
      Parameters:
      defaultValue - the default value to set
      Returns:
      False if the entry exists with a different type
      Throws:
      IllegalArgumentException - if the value is not a known type
    • setDefaultBoolean

      boolean setDefaultBoolean​(boolean defaultValue)
      Sets the entry's value if it does not exist.
      Parameters:
      defaultValue - the default value to set
      Returns:
      False if the entry exists with a different type
    • setDefaultInteger

      boolean setDefaultInteger​(long defaultValue)
      Sets the entry's value if it does not exist.
      Parameters:
      defaultValue - the default value to set
      Returns:
      False if the entry exists with a different type
    • setDefaultFloat

      boolean setDefaultFloat​(float defaultValue)
      Sets the entry's value if it does not exist.
      Parameters:
      defaultValue - the default value to set
      Returns:
      False if the entry exists with a different type
    • setDefaultDouble

      boolean setDefaultDouble​(double defaultValue)
      Sets the entry's value if it does not exist.
      Parameters:
      defaultValue - the default value to set
      Returns:
      False if the entry exists with a different type
    • setDefaultString

      boolean setDefaultString​(String defaultValue)
      Sets the entry's value if it does not exist.
      Parameters:
      defaultValue - the default value to set
      Returns:
      False if the entry exists with a different type
    • setDefaultRaw

      boolean setDefaultRaw​(byte[] defaultValue)
      Sets the entry's value if it does not exist.
      Parameters:
      defaultValue - the default value to set
      Returns:
      False if the entry exists with a different type
    • setDefaultBooleanArray

      boolean setDefaultBooleanArray​(boolean[] defaultValue)
      Sets the entry's value if it does not exist.
      Parameters:
      defaultValue - the default value to set
      Returns:
      False if the entry exists with a different type
    • setDefaultBooleanArray

      boolean setDefaultBooleanArray​(Boolean[] defaultValue)
    • setDefaultIntegerArray

      boolean setDefaultIntegerArray​(long[] defaultValue)
      Sets the entry's value if it does not exist.
      Parameters:
      defaultValue - the default value to set
      Returns:
      False if the entry exists with a different type
    • setDefaultIntegerArray

      boolean setDefaultIntegerArray​(Long[] defaultValue)
    • setDefaultFloatArray

      boolean setDefaultFloatArray​(float[] defaultValue)
      Sets the entry's value if it does not exist.
      Parameters:
      defaultValue - the default value to set
      Returns:
      False if the entry exists with a different type
    • setDefaultFloatArray

      boolean setDefaultFloatArray​(Float[] defaultValue)
    • setDefaultDoubleArray

      boolean setDefaultDoubleArray​(double[] defaultValue)
      Sets the entry's value if it does not exist.
      Parameters:
      defaultValue - the default value to set
      Returns:
      False if the entry exists with a different type
    • setDefaultDoubleArray

      boolean setDefaultDoubleArray​(Double[] defaultValue)
    • setDefaultStringArray

      boolean setDefaultStringArray​(String[] defaultValue)
      Sets the entry's value if it does not exist.
      Parameters:
      defaultValue - the default value to set
      Returns:
      False if the entry exists with a different type
    • accept

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