Package io.openems.edge.common.channel
Interface WriteChannel<T>
- All Superinterfaces:
Channel<T>
- All Known Implementing Classes:
BooleanWriteChannel
,DoubleWriteChannel
,EnumWriteChannel
,FloatWriteChannel
,IntegerWriteChannel
,LongWriteChannel
,ShortWriteChannel
,StringWriteChannel
-
Field Summary
Fields inherited from interface io.openems.edge.common.channel.Channel
NO_OF_PAST_VALUES
-
Method Summary
Modifier and TypeMethodDescriptionvoid
_setNextWriteValue
(T value) Deprecated.Gets the next write value.Gets the next write value and resets it.Gets the onSetNextWrite callbacks.void
Add an onSetNextWrite callback.default void
setNextWriteValue
(T value) Updates the 'next' write value of Channel.default void
Updates the 'next' write value of Channel from an Object value.Methods inherited from interface io.openems.edge.common.channel.Channel
_setNextValue, address, channelDoc, channelId, deactivate, getComponent, getMetaInfo, getNextValue, getPastValues, getType, nextProcessImage, onChange, onSetNextValue, onUpdate, removeOnChangeCallback, removeOnSetNextValueCallback, removeOnUpdateCallback, setMetaInfo, setNextValue, value
-
Method Details
-
setNextWriteValue
Updates the 'next' write value of Channel.- Parameters:
value
- the typed value- Throws:
OpenemsError.OpenemsNamedException
- on error
-
setNextWriteValueFromObject
default void setNextWriteValueFromObject(Object value) throws OpenemsError.OpenemsNamedException, IllegalArgumentException Updates the 'next' write value of Channel from an Object value.Use this method if the value is not yet in the correct Type. Otherwise use
setNextWriteValue(Object)
directly.- Parameters:
value
- the value as an Object- Throws:
OpenemsError.OpenemsNamedException
- on errorIllegalArgumentException
- on error
-
_setNextWriteValue
Deprecated.Internal method. Do not call directly.- Parameters:
value
- the value
-
getNextWriteValueAndReset
Gets the next write value and resets it.- Returns:
- the next write value
-
getNextWriteValue
Gets the next write value.- Returns:
- the next write value; not-present if no write value had been set
-
onSetNextWrite
Add an onSetNextWrite callback. It is called when a 'next write value' was set.The callback can throw an
OpenemsError.OpenemsNamedException
.- Parameters:
callback
- the callback
-
getOnSetNextWrites
List<ThrowingConsumer<T,OpenemsError.OpenemsNamedException>> getOnSetNextWrites()Gets the onSetNextWrite callbacks.- Returns:
- a List of callbacks
-