Package io.hyperfoil.api.config
Interface BuilderBase<S extends BuilderBase<S>>
- All Known Subinterfaces:
Action.Builder,Processor.Builder,RawBytesHandler.Builder,StepBuilder<S>,Transformer.Builder
- All Known Implementing Classes:
BaseSequenceBuilder,BaseSequenceBuilder.SimpleAdapter,Processor.ActionBuilderAdapter,SequenceBuilder,SLABuilder,StepBuilder.ActionAdapter
public interface BuilderBase<S extends BuilderBase<S>>
Intended base for all builders that might need relocation when the step is copied over.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classstatic @interfaceUsed to ignore copying the field (e.g. when it's final, or we don't want to call it 'parent').static interface -
Method Summary
Modifier and TypeMethodDescriptiondefault SSome scenarios copy its parts from one place to another, either during parsing phase (e.g. through YAML anchors) or inprepareBuild().default void
-
Method Details
-
prepareBuild
default void prepareBuild() -
copy
Some scenarios copy its parts from one place to another, either during parsing phase (e.g. through YAML anchors) or inprepareBuild(). In order to make sure that modification in one place does not accidentally change the original one we require defining a deep copy method on each builder. The only exception is when the builder is immutable (including potential children builder); in that case the deep copy is not necessary and this method can returnthis.The default implementation uses reflection to create a deep copy of all collections and maps, calling
copy()on all objects implementingBuilderBase.- Parameters:
newParent- Object passed to a matching constructor.- Returns:
- Deep copy of this object.
-