Interface StateBuilderSteps.OnOffStep

All Known Subinterfaces:
StateBuilderSteps.BuildStep
All Known Implementing Classes:
State.Builder
Enclosing class:
StateBuilderSteps

public static interface StateBuilderSteps.OnOffStep
  • Method Summary

    Modifier and Type Method Description
    default State keepCurrentState()
    Keeps the current state of the light to which this state is assigned: if it's on, it stays on, and if it's off, it stays off.
    default State off()
    Creates a new State that will turn off the light to which it is assigned.
    default State on()
    Creates a new State that will turn on the light to which it is assigned.
    State on​(java.lang.Boolean on)  
  • Method Details

    • on

      State on​(java.lang.Boolean on)
    • on

      default State on()
      Creates a new State that will turn on the light to which it is assigned. A shorthand method for on(true). Avoid calling in vain if you know the light is on already.
      Returns:
      A new State.
    • off

      default State off()
      Creates a new State that will turn off the light to which it is assigned. A shorthand method for on(false).
      Returns:
      A new State.
    • keepCurrentState

      default State keepCurrentState()
      Keeps the current state of the light to which this state is assigned: if it's on, it stays on, and if it's off, it stays off. A shorthand method for on(null).
      Returns:
      A new State.