Interface ChannelDictionary<K,C extends Channel,A>
- Type Parameters:
K
- the key typeC
- the channel typeA
- the type of the associated data
- All Known Implementing Classes:
ChannelManager
,ChannelTracker
public interface ChannelDictionary<K,C extends Channel,A>
Supports the lookup of a channel by a name (an id).
As a convenience, it is possible to additionally associate arbitrary data with the entry (and thus with the channel). Note that this interface defines a read-only view of the dictionary.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic final record
ChannelDictionary.Value<C extends Channel,
A> Combines the channel and the associated data. -
Method Summary
Modifier and TypeMethodDescriptiondefault Collection
<A> Returns all known associated data.associated
(K key) Return the data associated with the entry for the channel.Returns the channel registered for the key or an empty optional if no mapping exists.default Collection
<C> channels()
Return all known channels.keys()
Returns all known keys.Returns the channel and associates data registered for the key or an empty optional if no entry exists.values()
Return all known values.
-
Method Details
-
keys
Returns all known keys.- Returns:
- the keys
-
values
Return all known values.- Returns:
- the collection
-
value
Returns the channel and associates data registered for the key or an empty optional if no entry exists.- Parameters:
key
- the key- Returns:
- the result
-
channels
Return all known channels.- Returns:
- the collection
-
channel
Returns the channel registered for the key or an empty optional if no mapping exists.- Parameters:
key
- the key- Returns:
- the optional
-
associated
Returns all known associated data.- Returns:
- the collection
-
associated
Return the data associated with the entry for the channel.- Parameters:
key
- the key- Returns:
- the data
-