Class WriteObject
java.lang.Object
io.openems.edge.controller.api.common.WriteObject
- Direct Known Subclasses:
WritePojo
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract boolean
isNull()
Is there a defined value?.void
Notify error while setting the value.void
Notify success for setting the value.void
Notify a timeout for setting the value.onError
(Consumer<OpenemsException> callback) Callback on error while setting the value.onFirstError
(Consumer<OpenemsException> callback) Callback on first error while setting the value.onFirstSuccess
(Runnable callback) Callback on first successful setting of the value.Callback on successful setting of the value.Callback on timeout while setting the value.abstract void
setNextWriteValue
(WriteChannel<?> writeChannel) Set the next write value of the Channel.abstract String
Gets the value as a String for logging purposes.
-
Constructor Details
-
WriteObject
public WriteObject()
-
-
Method Details
-
onSuccess
Callback on successful setting of the value.- Parameters:
callback
- a callbackRunnable
- Returns:
- myself
-
onFirstSuccess
Callback on first successful setting of the value.- Parameters:
callback
- a callbackRunnable
- Returns:
- myself
-
onError
Callback on error while setting the value.- Parameters:
callback
- a callbackRunnable
- Returns:
- myself
-
onFirstError
Callback on first error while setting the value.- Parameters:
callback
- a callbackRunnable
- Returns:
- myself
-
onTimeout
Callback on timeout while setting the value.- Parameters:
callback
- a callbackRunnable
- Returns:
- myself
-
notifySuccess
public void notifySuccess()Notify success for setting the value. -
notifyError
Notify error while setting the value.- Parameters:
e
- theOpenemsException
-
notifyTimeout
public void notifyTimeout()Notify a timeout for setting the value. -
setNextWriteValue
public abstract void setNextWriteValue(WriteChannel<?> writeChannel) throws OpenemsError.OpenemsNamedException Set the next write value of the Channel.- Parameters:
writeChannel
- theWriteChannel
- Throws:
OpenemsError.OpenemsNamedException
- on error
-
valueToString
Gets the value as a String for logging purposes.- Returns:
- the value as String
-
isNull
public abstract boolean isNull()Is there a defined value?.- Returns:
- true if no value is there; false if a value is available.
-