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

    Constructors
    Constructor
    Description
     
  • Method Summary

    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

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

    • Builder

      public Builder()
  • Method Details

    • self

      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

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

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

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

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

      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