Interface ChannelDictionary<K,C extends Channel,A>

Type Parameters:
K - the key type
C - the channel type
A - 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.

  • Method Details

    • keys

      Set<K> 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

      default Collection<C> channels()
      Return all known channels.
      Returns:
      the collection
    • channel

      default Optional<C> channel(K key)
      Returns the channel registered for the key or an empty optional if no mapping exists.
      Parameters:
      key - the key
      Returns:
      the optional
    • associated

      default Collection<A> associated()
      Returns all known associated data.
      Returns:
      the collection
    • associated

      default Optional<A> associated(K key)
      Return the data associated with the entry for the channel.
      Parameters:
      key - the key
      Returns:
      the data