ch.sahits.model
Interface IBuilder<T extends IBuildable>

Type Parameters:
T - Type that should be built by the builder. T must implement the IBuildable interface
All Known Subinterfaces:
IOutputFileModelBuilder, IPHPClassDeclarationBuilder, IPHPMethodDeclarationBuilder, IWebserviceBuilder

public interface IBuilder<T extends IBuildable>

This interface defines the facilities that are needed by a Builder class. A Builder can initialize an object especially an immutable object.

 public T(IBuilder){
   ...
 }
 
The constructor of T must only be accessibly by the build() method. This can be done by making the IBuilder an inner class of T.

Since:
1.2.0
Author:
Andi Hotz, Sahits GmbH

Method Summary
 T build()
          Create an instance of T.
 

Method Detail

build

T build()
Create an instance of T. If T is a singleton and an instance of T already exists the build may fail

Returns:
instance of the created method
Throws:
java.lang.IllegalArgumentException - a instance of the singleton T is already in existence.
java.lang.IllegalStateException - if the IBuilder was not properly initialized