Class MapNetworkPublisher<T>
- java.lang.Object
-
- edu.wpi.grip.core.operations.network.NetworkPublisher<java.util.Map<java.lang.String,T>>
-
- edu.wpi.grip.core.operations.network.MapNetworkPublisher<T>
-
- Type Parameters:
T
- The type of the 'value' in the string, value map that is being published
- All Implemented Interfaces:
java.lang.AutoCloseable
public abstract class MapNetworkPublisher<T> extends NetworkPublisher<java.util.Map<java.lang.String,T>>
Publishes a map of keys to values.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
MapNetworkPublisher(java.util.Set<java.lang.String> keys)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract void
doPublish()
Publishes nothing.protected abstract void
doPublish(java.util.Map<java.lang.String,T> publishMap)
Publishes a key value mapping.protected abstract void
doPublishSingle(T value)
Publish a single value using theNetworkPublisher.name
as the key.void
publish(java.util.Map<java.lang.String,T> publishMap)
Publishes the given key/value pair to the network publisher.-
Methods inherited from class edu.wpi.grip.core.operations.network.NetworkPublisher
checkNamePresent, close, publishNameChanged, setName
-
-
-
-
Method Detail
-
publish
public final void publish(java.util.Map<java.lang.String,T> publishMap)
Publishes the given key/value pair to the network publisher. The key must be in the set of keys provided to the constructor.- Specified by:
publish
in classNetworkPublisher<java.util.Map<java.lang.String,T>>
- Parameters:
publishMap
- the keyValues to publish
-
doPublish
protected abstract void doPublish()
Publishes nothing.
-
doPublish
protected abstract void doPublish(java.util.Map<java.lang.String,T> publishMap)
Publishes a key value mapping.- Parameters:
publishMap
- The mapping of keys to values to be published
-
doPublishSingle
protected abstract void doPublishSingle(T value)
Publish a single value using theNetworkPublisher.name
as the key.- Parameters:
value
- The value to be published
-
-