Interface CaseCreator

All Superinterfaces:
BodyCreator

public sealed interface CaseCreator extends BodyCreator
A creator for switch statement and expression cases. Each case must declare at least one case value before building the body of the case.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Build the body of this executable code.
    default void
    of(int val)
    Add a constant for this case.
    default void
    of(long val)
    Add a constant for this case.
    void
    of(Const val)
    Add a constant for this case.
    default void
    Add a constant for this case.
    default void
    Add a constant for this case.
    default void
    of(String val)
    Add a constant for this case.
  • Method Details

    • of

      void of(Const val)
      Add a constant for this case.
      Parameters:
      val - the case value to add (must not be null)
    • of

      default void of(Constable val)
      Add a constant for this case.
      Parameters:
      val - the case value to add (must not be null)
    • of

      default void of(ConstantDesc val)
      Add a constant for this case.
      Parameters:
      val - the case value to add (must not be null)
    • of

      default void of(String val)
      Add a constant for this case.
      Parameters:
      val - the case value to add (must not be null)
    • of

      default void of(int val)
      Add a constant for this case.
      Parameters:
      val - the case value to add (must not be null)
    • of

      default void of(long val)
      Add a constant for this case.
      Parameters:
      val - the case value to add (must not be null)
    • body

      void body(Consumer<BlockCreator> builder)
      Description copied from interface: BodyCreator
      Build the body of this executable code.
      Specified by:
      body in interface BodyCreator
      Parameters:
      builder - the builder (must not be null)