public class ChannelMapper extends Object
Constructor and Description |
---|
ChannelMapper(java.util.function.IntFunction<Channel> channelGetter,
java.util.function.IntFunction<Optional<ChannelConverterAttached<Channel,UnsignedByteBuffer>>> converterGetter) |
Modifier and Type | Method and Description |
---|---|
void |
consumeChannelIfSupported(int channelIndex,
java.util.function.BiConsumer<Channel,ChannelConverterAttached<Channel,UnsignedByteBuffer>> consumer,
java.util.function.Consumer<Channel> fallback)
Like
mapChannelIfSupported(int, BiFunction, Function) but the mapping has no
return-type. |
<T> T |
mapChannelIfSupported(int channelIndex,
java.util.function.BiFunction<Channel,ChannelConverterAttached<Channel,UnsignedByteBuffer>,T> mapFunction,
java.util.function.Function<Channel,T> fallback)
|
public ChannelMapper(java.util.function.IntFunction<Channel> channelGetter, java.util.function.IntFunction<Optional<ChannelConverterAttached<Channel,UnsignedByteBuffer>>> converterGetter)
public <T> T mapChannelIfSupported(int channelIndex, java.util.function.BiFunction<Channel,ChannelConverterAttached<Channel,UnsignedByteBuffer>,T> mapFunction, java.util.function.Function<Channel,T> fallback)
T
- the destination type to map to.channelIndex
- the index of the channel to map, as well as the corresponding converter.mapFunction
- used for the mapping, if a corresponding converter for channelIndex
exists.fallback
- used for the mapping, if a corresponding converter for channelIndex
does not exist.public void consumeChannelIfSupported(int channelIndex, java.util.function.BiConsumer<Channel,ChannelConverterAttached<Channel,UnsignedByteBuffer>> consumer, java.util.function.Consumer<Channel> fallback)
mapChannelIfSupported(int, BiFunction, Function)
but the mapping has no
return-type.channelIndex
- the index of the channel to consume, as well as the corresponding
converter.consumer
- used for the consuming, if a corresponding converter for channelIndex
exists.fallback
- used for the consuming, if a corresponding converter for channelIndex
does not exist.Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.