Class AbstractBuilder<T>
- java.lang.Object
-
- de.fraunhofer.iosb.ilt.sta.model.builder.api.AbstractBuilder<T>
-
- Type Parameters:
T
- the instance class type to build
- All Implemented Interfaces:
Builder<T>
- Direct Known Subclasses:
ExtensibleBuilder
public abstract class AbstractBuilder<T> extends Object implements Builder<T>
Base class for anyBuilder
.Any
AbstractBuilder
keeps a reference to the instance under construction. This reference is created thanks tonewBuildingInstance()
and finally returned when callingbuild()
- Author:
- Aurelien Bourdon
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractBuilder()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description T
build()
Finalize the build of the instance under construction and get itprotected T
getBuildingInstance()
Get the instance under constructionprotected abstract T
newBuildingInstance()
Create the new instance that will be build by thisAbstractBuilder
-
-
-
Method Detail
-
newBuildingInstance
protected abstract T newBuildingInstance()
Create the new instance that will be build by thisAbstractBuilder
- Returns:
- the new instance that will be build by this
AbstractBuilder
-
getBuildingInstance
protected T getBuildingInstance()
Get the instance under construction- Returns:
- the instance under construction
-
build
public T build()
Finalize the build of the instance under construction and get it- Specified by:
build
in interfaceBuilder<T>
- Returns:
- the created instance by this
AbstractBuilder
-
-