public class ProtocolUtils
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ProtocolUtils.Pair<P extends Protocol,F extends ProtocolFactory<P>>
|
| Constructor and Description |
|---|
ProtocolUtils() |
| Modifier and Type | Method and Description |
|---|---|
static <T extends Protocol> |
protocolFactoryPair(ProtocolFactory<T> pf)
|
static java.util.Map<java.lang.Class<? extends Protocol>,ProtocolFactory<?>> |
protocolsMapping(java.util.List<ProtocolFactory<?>> protocolFactories)
Creates simple
Map of {Protocol -> ProtocolFactory}
entries using the given list of ProtocolFactory instances, where
each ProtocolFactory instance mapped to the Protocol type
that this factory can produce. |
public static <T extends Protocol> ProtocolUtils.Pair<T,ProtocolFactory<T>> protocolFactoryPair(ProtocolFactory<T> pf)
Creates ProtocolUtils.Pair (Protocol, ProtocolFactory) using the given ProtocolFactory
instance.
Pair is based on ProtocolFactory generic types and is intended to programmable usage for
configuration or dispatching purposes.
pf - ProtocolFactory to be paired with the Protocol typePair of Protocol and ProtocolFactorypublic static java.util.Map<java.lang.Class<? extends Protocol>,ProtocolFactory<?>> protocolsMapping(java.util.List<ProtocolFactory<?>> protocolFactories)
Creates simple Map of {Protocol -> ProtocolFactory}
entries using the given list of ProtocolFactory instances, where
each ProtocolFactory instance mapped to the Protocol type
that this factory can produce.
protocolFactories - factories to be mapped to produced protocol types, can't be null.{ protocol -> factory } map, can't be null.