Class GenericScene.Builder<B extends GenericScene.Builder<B>>

java.lang.Object
com.calebleavell.textinterface.scenes.GenericScene.Builder<B>
Direct Known Subclasses:
ContainerScene.Builder, NumberedListInputScene.Builder, NumberedListScene.Builder, NumberedSceneSelectorScene.Builder, TextApplication.Builder, TextInputScene.Builder, TextScene.Builder
Enclosing class:
GenericScene

public abstract static class GenericScene.Builder<B extends GenericScene.Builder<B>> extends Object
Uses a Builder design pattern Extending this class makes extending this Builder easy, but extending any subclasses of this class will be difficult
  • Constructor Summary Link icon

    Constructors
    Constructor
    Description
     
  • Method Summary Link icon

    Modifier and Type
    Method
    Description
    abstract Scene
    Initializes a new object of the class that the implementation is contained in
    children(Scene... children)
    Set the children field dynamically
    children(List<Scene> children)
    Set the children field
    functions(Function... functions)
    Set the list of functions dynamically
    name(String name)
    Set the name field
    Return a version of this of type B It is safe to suppress the warning on the user side, assuming subclasses are implemented correctly

    Methods inherited from class java.lang.Object Link icon

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details Link icon

    • Builder Link icon

      public Builder()
  • Method Details Link icon

    • self Link icon

      public B self()
      Return a version of this of type B It is safe to suppress the warning on the user side, assuming subclasses are implemented correctly
      Returns:
      this, casted to B
    • name Link icon

      public B name(String name)
      Set the name field
      Parameters:
      name - The name of the Scene
      Returns:
      this, casted to B
    • children Link icon

      public B children(List<Scene> children)
      Set the children field
      Parameters:
      children - The list of children
      Returns:
      this, casted to B
    • children Link icon

      public B children(Scene... children)
      Set the children field dynamically
      Parameters:
      children - The list of children
      Returns:
      this, casted to B
    • functions Link icon

      public B functions(Function... functions)
      Set the list of functions dynamically
      Parameters:
      functions - The list of functions
      Returns:
      this, casted to B
    • build Link icon

      public abstract Scene build()
      Initializes a new object of the class that the implementation is contained in
      Returns:
      A new Scene (or subclass of Scene) with the fields of the Builder