Class WriteObject

java.lang.Object
io.openems.edge.controller.api.common.WriteObject
Direct Known Subclasses:
WritePojo

public abstract class WriteObject extends Object
  • Constructor Details

    • WriteObject

      public WriteObject()
  • Method Details

    • onSuccess

      public WriteObject onSuccess(Runnable callback)
      Callback on successful setting of the value.
      Parameters:
      callback - a callback Runnable
      Returns:
      myself
    • onFirstSuccess

      public WriteObject onFirstSuccess(Runnable callback)
      Callback on first successful setting of the value.
      Parameters:
      callback - a callback Runnable
      Returns:
      myself
    • onError

      public WriteObject onError(Consumer<OpenemsException> callback)
      Callback on error while setting the value.
      Parameters:
      callback - a callback Runnable
      Returns:
      myself
    • onFirstError

      public WriteObject onFirstError(Consumer<OpenemsException> callback)
      Callback on first error while setting the value.
      Parameters:
      callback - a callback Runnable
      Returns:
      myself
    • onTimeout

      public WriteObject onTimeout(Runnable callback)
      Callback on timeout while setting the value.
      Parameters:
      callback - a callback Runnable
      Returns:
      myself
    • notifySuccess

      public void notifySuccess()
      Notify success for setting the value.
    • notifyError

      public void notifyError(OpenemsException e)
      Notify error while setting the value.
      Parameters:
      e - the OpenemsException
    • 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 - the WriteChannel
      Throws:
      OpenemsError.OpenemsNamedException - on error
    • valueToString

      public abstract String 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.