Class AbstractOpenemsModbusComponent.ChannelMapper<T extends AbstractModbusElement<?>>
- java.lang.Object
-
- io.openems.edge.bridge.modbus.api.AbstractOpenemsModbusComponent.ChannelMapper<T>
-
- Enclosing class:
- AbstractOpenemsModbusComponent
public class AbstractOpenemsModbusComponent.ChannelMapper<T extends AbstractModbusElement<?>> extends java.lang.Object
Maps an Element to one or more ModbusChannels using converters, that convert the value forward and backwards.
-
-
Constructor Summary
Constructors Constructor Description ChannelMapper(T element)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
build()
Builds theAbstractOpenemsModbusComponent.ChannelMapper
.AbstractOpenemsModbusComponent.ChannelMapper<T>
m(ChannelId channelId, ElementToChannelConverter converter)
Maps the given element 1-to-1 to the Channel identified by channelId.AbstractOpenemsModbusComponent.ChannelMapper<T>
m(ChannelId channelId, ElementToChannelConverter converter, ChannelMetaInfo channelMetaInfo)
Maps the given element 1-to-1 to the Channel identified by channelId.AbstractOpenemsModbusComponent.ChannelMapper<T>
m(ChannelId channelId, java.util.function.Function<java.lang.Object,java.lang.Object> elementToChannel, java.util.function.Function<java.lang.Object,java.lang.Object> channelToElement)
Maps the given element to the Channel identified by channelId, applying the given @link{ElementToChannelConverter}.
-
-
-
Constructor Detail
-
ChannelMapper
public ChannelMapper(T element)
-
-
Method Detail
-
m
public AbstractOpenemsModbusComponent.ChannelMapper<T> m(ChannelId channelId, ElementToChannelConverter converter)
Maps the given element 1-to-1 to the Channel identified by channelId.- Parameters:
channelId
- the Channel-IDconverter
- theElementToChannelConverter
- Returns:
- the element parameter
-
m
public AbstractOpenemsModbusComponent.ChannelMapper<T> m(ChannelId channelId, ElementToChannelConverter converter, ChannelMetaInfo channelMetaInfo)
Maps the given element 1-to-1 to the Channel identified by channelId.- Parameters:
channelId
- the Channel-IDconverter
- theElementToChannelConverter
channelMetaInfo
- an object that holds meta information about the Channel- Returns:
- the element parameter
-
m
public AbstractOpenemsModbusComponent.ChannelMapper<T> m(ChannelId channelId, java.util.function.Function<java.lang.Object,java.lang.Object> elementToChannel, java.util.function.Function<java.lang.Object,java.lang.Object> channelToElement)
Maps the given element to the Channel identified by channelId, applying the given @link{ElementToChannelConverter}.
-
build
public T build()
Builds theAbstractOpenemsModbusComponent.ChannelMapper
.- Returns:
- the
AbstractOpenemsModbusComponent.ChannelMapper
-
-