Package codechicken.lib.model.pipeline
Class BakedPipeline.Builder
java.lang.Object
codechicken.lib.model.pipeline.BakedPipeline.Builder
- Enclosing class:
BakedPipeline
The builder associated with the BakedPipeline.
You must create a BakedPipeline with this,
once created a pipeline cannot be modified,
modifying should not be needed as you can enable
and disable elements with ease.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddElement(String name, IPipelineElementFactory<?> factory) Adds an element at the end of the transform list, Suitable for 99% of cases.addElement(String name, IPipelineElementFactory<?> factory, boolean defaultState) Adds an element at the end of the transform list, Suitable for 99% of cases.<T extends IPipelineConsumer>
BakedPipeline.BuilderaddElement(String name, IPipelineElementFactory<T> factory, boolean defaultState, Consumer<T> defaultsSetter) Adds an element at the end of the transform list, Suitable for 99% of cases.addFirst(String name, IPipelineElementFactory<?> factory) Inserts an element to the front of the list, Useful if you have a more complex system and each system need to be independent from each other, but this element must be first.addFirst(String name, IPipelineElementFactory<?> factory, boolean defaultState) Inserts an element to the front of the list, Useful if you have a more complex system and each system need to be independent from each other, but this element must be first.<T extends IPipelineConsumer>
BakedPipeline.BuilderaddFirst(String name, IPipelineElementFactory<T> factory, boolean defaultState, Consumer<T> defaultsSetter) Inserts an element to the front of the list, Useful if you have a more complex system and each system need to be independent from each other, but this element must be first.build()Call this once you are finished to build your BakedPipeline!
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
addFirst
Inserts an element to the front of the list, Useful if you have a more complex system and each system need to be independent from each other, but this element must be first.- Parameters:
name- The name to identify this element, used as an identifier when setting state, and retrieving the element.factory- The factory used to create the Transformer.- Returns:
- The same builder.
-
addFirst
public BakedPipeline.Builder addFirst(String name, IPipelineElementFactory<?> factory, boolean defaultState) Inserts an element to the front of the list, Useful if you have a more complex system and each system need to be independent from each other, but this element must be first.- Parameters:
name- The name to identify this element, used as an identifier when setting state, and retrieving the element.factory- The factory used to create the Transformer.defaultState- The default state for this element.- Returns:
- The same builder.
-
addFirst
public <T extends IPipelineConsumer> BakedPipeline.Builder addFirst(String name, IPipelineElementFactory<T> factory, boolean defaultState, Consumer<T> defaultsSetter) Inserts an element to the front of the list, Useful if you have a more complex system and each system need to be independent from each other, but this element must be first.- Parameters:
name- The name to identify this element, used as an identifier when setting state, and retrieving the element.factory- The factory used to create the Transformer.defaultState- The default state for this element.defaultsSetter- A callback used to set any defaults on the transformer.- Returns:
- The same builder.
-
addElement
Adds an element at the end of the transform list, Suitable for 99% of cases.- Parameters:
name- The name to identify this element, used as an identifier when setting state, and retrieving the element.factory- The factory used to create the Transformer.- Returns:
- The same builder.
-
addElement
public BakedPipeline.Builder addElement(String name, IPipelineElementFactory<?> factory, boolean defaultState) Adds an element at the end of the transform list, Suitable for 99% of cases.- Parameters:
name- The name to identify this element, used as an identifier when setting state, and retrieving the element.factory- The factory used to create the Transformer.defaultState- The default state for this element.- Returns:
- The same builder.
-
addElement
public <T extends IPipelineConsumer> BakedPipeline.Builder addElement(String name, IPipelineElementFactory<T> factory, boolean defaultState, Consumer<T> defaultsSetter) Adds an element at the end of the transform list, Suitable for 99% of cases.- Parameters:
name- The name to identify this element, used as an identifier when setting state, and retrieving the element.factory- The factory used to create the Transformer.defaultState- The default state for this element.defaultsSetter- A callback used to set any defaults on the transformer.- Returns:
- The same builder.
-
build
Call this once you are finished to build your BakedPipeline!- Returns:
- The new Pipeline.
-