Interface SwitchCreator

All Superinterfaces:
SimpleTyped, Typed

public sealed interface SwitchCreator extends SimpleTyped
A creator for a switch statement. The individual switch cases do not fall through. To simulate fall-through behavior, use BlockCreator.gotoCase(SwitchCreator, Const) or one of its variants at the end of each case.
  • Method Details

    • case_

      void case_(Consumer<CaseCreator> builder)
      Add a switch case.
      Parameters:
      builder - the switch case builder (must not be null)
    • caseOf

      default void caseOf(Const val, Consumer<BlockCreator> body)
      Add a simple switch case.
      Parameters:
      val - the case value to add (must not be null)
      body - the switch case body builder (must not be null)
    • caseOf

      default void caseOf(Constable val, Consumer<BlockCreator> body)
      Add a simple switch case.
      Parameters:
      val - the case value to add (must not be null)
      body - the switch case body builder (must not be null)
    • caseOf

      default void caseOf(ConstantDesc val, Consumer<BlockCreator> body)
      Add a simple switch case.
      Parameters:
      val - the case value to add (must not be null)
      body - the switch case body builder (must not be null)
    • caseOf

      default void caseOf(String val, Consumer<BlockCreator> body)
      Add a simple switch case.
      Parameters:
      val - the case value to add (must not be null)
      body - the switch case body builder (must not be null)
    • caseOf

      default void caseOf(int val, Consumer<BlockCreator> body)
      Add a simple switch case.
      Parameters:
      val - the case value to add (must not be null)
      body - the switch case body builder (must not be null)
    • caseOf

      default void caseOf(long val, Consumer<BlockCreator> body)
      Add a simple switch case.
      Parameters:
      val - the case value to add (must not be null)
      body - the switch case body builder (must not be null)
    • default_

      void default_(Consumer<BlockCreator> body)
      Add the default case.
      Parameters:
      body - the builder for the body of the default case (must not be null)