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
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 -
Method Summary
Modifier and TypeMethodDescriptionabstract Scene
build()
Initializes a new object of the class that the implementation is contained inSet the children field dynamicallySet the children fieldSet the list of functions dynamicallySet the name fieldself()
Return a version of this of type B It is safe to suppress the warning on the user side, assuming subclasses are implemented correctly
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
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
Set the name field- Parameters:
name
- The name of the Scene- Returns:
- this, casted to B
-
children
Set the children field- Parameters:
children
- The list of children- Returns:
- this, casted to B
-
children
Set the children field dynamically- Parameters:
children
- The list of children- Returns:
- this, casted to B
-
functions
Set the list of functions dynamically- Parameters:
functions
- The list of functions- Returns:
- this, casted to B
-
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
-