Package edu.wpi.first.networktables
Interface GenericPublisher
- All Superinterfaces:
AutoCloseable
,Consumer<NetworkTableValue>
,Publisher
,PubSub
- All Known Subinterfaces:
GenericEntry
public interface GenericPublisher extends Publisher, Consumer<NetworkTableValue>
NetworkTables generic publisher.
-
Method Summary
Modifier and Type Method Description default void
accept(NetworkTableValue value)
Topic
getTopic()
Get the corresponding topic.boolean
set(NetworkTableValue value)
Publish a new value.default boolean
setBoolean(boolean value)
Publish a new value.boolean
setBoolean(boolean value, long time)
Publish a new value.default boolean
setBooleanArray(boolean[] value)
Publish a new value.boolean
setBooleanArray(boolean[] value, long time)
Publish a new value.default boolean
setBooleanArray(Boolean[] value)
Publish a new value.boolean
setBooleanArray(Boolean[] value, long time)
Publish a new value.boolean
setDefault(NetworkTableValue defaultValue)
Sets the entry's value if it does not exist.boolean
setDefaultBoolean(boolean defaultValue)
Sets the entry's value if it does not exist.boolean
setDefaultBooleanArray(boolean[] defaultValue)
Sets the entry's value if it does not exist.boolean
setDefaultBooleanArray(Boolean[] defaultValue)
boolean
setDefaultDouble(double defaultValue)
Sets the entry's value if it does not exist.boolean
setDefaultDoubleArray(double[] defaultValue)
Sets the entry's value if it does not exist.boolean
setDefaultDoubleArray(Double[] defaultValue)
boolean
setDefaultFloat(float defaultValue)
Sets the entry's value if it does not exist.boolean
setDefaultFloatArray(float[] defaultValue)
Sets the entry's value if it does not exist.boolean
setDefaultFloatArray(Float[] defaultValue)
boolean
setDefaultInteger(long defaultValue)
Sets the entry's value if it does not exist.boolean
setDefaultIntegerArray(long[] defaultValue)
Sets the entry's value if it does not exist.boolean
setDefaultIntegerArray(Long[] defaultValue)
boolean
setDefaultRaw(byte[] defaultValue)
Sets the entry's value if it does not exist.boolean
setDefaultString(String defaultValue)
Sets the entry's value if it does not exist.boolean
setDefaultStringArray(String[] defaultValue)
Sets the entry's value if it does not exist.boolean
setDefaultValue(Object defaultValue)
Sets the entry's value if it does not exist.default boolean
setDouble(double value)
Publish a new value.boolean
setDouble(double value, long time)
Publish a new value.default boolean
setDoubleArray(double[] value)
Publish a new value.boolean
setDoubleArray(double[] value, long time)
Publish a new value.default boolean
setDoubleArray(Double[] value)
Publish a new value.boolean
setDoubleArray(Double[] value, long time)
Publish a new value.default boolean
setFloat(float value)
Publish a new value.boolean
setFloat(float value, long time)
Publish a new value.default boolean
setFloatArray(float[] value)
Publish a new value.boolean
setFloatArray(float[] value, long time)
Publish a new value.default boolean
setFloatArray(Float[] value)
Publish a new value.boolean
setFloatArray(Float[] value, long time)
Publish a new value.default boolean
setInteger(long value)
Publish a new value.boolean
setInteger(long value, long time)
Publish a new value.default boolean
setIntegerArray(long[] value)
Publish a new value.boolean
setIntegerArray(long[] value, long time)
Publish a new value.default boolean
setIntegerArray(Long[] value)
Publish a new value.boolean
setIntegerArray(Long[] value, long time)
Publish a new value.default boolean
setRaw(byte[] value)
Publish a new value.boolean
setRaw(byte[] value, long time)
Publish a new value.default boolean
setString(String value)
Publish a new value.boolean
setString(String value, long time)
Publish a new value.default boolean
setStringArray(String[] value)
Publish a new value.boolean
setStringArray(String[] value, long time)
Publish a new value.default boolean
setValue(Object value)
Publish a new value.boolean
setValue(Object value, long time)
Publish a new value.
-
Method Details
-
getTopic
Get the corresponding topic. -
set
Publish a new value.- Parameters:
value
- value to publish- Returns:
- False if the topic already exists with a different type
-
setValue
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
Publish a new value.- Parameters:
value
- value to publishtime
- 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
Publish a new value.- Parameters:
value
- value to publish- Returns:
- False if the topic already exists with a different type
-
setBoolean
Publish a new value.- Parameters:
value
- value to publishtime
- timestamp; 0 indicates current NT time should be used- Returns:
- False if the topic already exists with a different type
-
setInteger
Publish a new value.- Parameters:
value
- value to publish- Returns:
- False if the topic already exists with a different type
-
setInteger
Publish a new value.- Parameters:
value
- value to publishtime
- timestamp; 0 indicates current NT time should be used- Returns:
- False if the topic already exists with a different type
-
setFloat
Publish a new value.- Parameters:
value
- value to publish- Returns:
- False if the topic already exists with a different type
-
setFloat
Publish a new value.- Parameters:
value
- value to publishtime
- timestamp; 0 indicates current NT time should be used- Returns:
- False if the topic already exists with a different type
-
setDouble
Publish a new value.- Parameters:
value
- value to publish- Returns:
- False if the topic already exists with a different type
-
setDouble
Publish a new value.- Parameters:
value
- value to publishtime
- timestamp; 0 indicates current NT time should be used- Returns:
- False if the topic already exists with a different type
-
setString
Publish a new value.- Parameters:
value
- value to publish- Returns:
- False if the topic already exists with a different type
-
setString
Publish a new value.- Parameters:
value
- value to publishtime
- timestamp; 0 indicates current NT time should be used- Returns:
- False if the topic already exists with a different type
-
setRaw
Publish a new value.- Parameters:
value
- value to publish- Returns:
- False if the topic already exists with a different type
-
setRaw
Publish a new value.- Parameters:
value
- value to publishtime
- timestamp; 0 indicates current NT time should be used- Returns:
- False if the topic already exists with a different type
-
setBooleanArray
Publish a new value.- Parameters:
value
- value to publish- Returns:
- False if the topic already exists with a different type
-
setBooleanArray
Publish a new value.- Parameters:
value
- value to publishtime
- timestamp; 0 indicates current NT time should be used- Returns:
- False if the topic already exists with a different type
-
setBooleanArray
Publish a new value.- Parameters:
value
- value to publish- Returns:
- False if the topic already exists with a different type
-
setBooleanArray
Publish a new value.- Parameters:
value
- value to publishtime
- timestamp; 0 indicates current NT time should be used- Returns:
- False if the topic already exists with a different type
-
setIntegerArray
Publish a new value.- Parameters:
value
- value to publish- Returns:
- False if the topic already exists with a different type
-
setIntegerArray
Publish a new value.- Parameters:
value
- value to publishtime
- timestamp; 0 indicates current NT time should be used- Returns:
- False if the topic already exists with a different type
-
setIntegerArray
Publish a new value.- Parameters:
value
- value to publish- Returns:
- False if the topic already exists with a different type
-
setIntegerArray
Publish a new value.- Parameters:
value
- value to publishtime
- timestamp; 0 indicates current NT time should be used- Returns:
- False if the topic already exists with a different type
-
setFloatArray
Publish a new value.- Parameters:
value
- value to publish- Returns:
- False if the topic already exists with a different type
-
setFloatArray
Publish a new value.- Parameters:
value
- value to publishtime
- timestamp; 0 indicates current NT time should be used- Returns:
- False if the topic already exists with a different type
-
setFloatArray
Publish a new value.- Parameters:
value
- value to publish- Returns:
- False if the topic already exists with a different type
-
setFloatArray
Publish a new value.- Parameters:
value
- value to publishtime
- timestamp; 0 indicates current NT time should be used- Returns:
- False if the topic already exists with a different type
-
setDoubleArray
Publish a new value.- Parameters:
value
- value to publish- Returns:
- False if the topic already exists with a different type
-
setDoubleArray
Publish a new value.- Parameters:
value
- value to publishtime
- timestamp; 0 indicates current NT time should be used- Returns:
- False if the topic already exists with a different type
-
setDoubleArray
Publish a new value.- Parameters:
value
- value to publish- Returns:
- False if the topic already exists with a different type
-
setDoubleArray
Publish a new value.- Parameters:
value
- value to publishtime
- timestamp; 0 indicates current NT time should be used- Returns:
- False if the topic already exists with a different type
-
setStringArray
Publish a new value.- Parameters:
value
- value to publish- Returns:
- False if the topic already exists with a different type
-
setStringArray
Publish a new value.- Parameters:
value
- value to publishtime
- timestamp; 0 indicates current NT time should be used- Returns:
- False if the topic already exists with a different type
-
setDefault
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
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
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
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
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
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
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
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
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
-
setDefaultIntegerArray
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
-
setDefaultFloatArray
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
-
setDefaultDoubleArray
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
-
setDefaultStringArray
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
- Specified by:
accept
in interfaceConsumer<NetworkTableValue>
-