net.sf.staccatocommons.lang.builder
Interface ReusableBuilder<T>

Type Parameters:
T - the type of built object
All Superinterfaces:
Builder<T>
All Known Implementing Classes:
AbstractReusableBuilder

public interface ReusableBuilder<T>
extends Builder<T>

A ReusableBuilder is a Builder whose build() method can be invoked more than once, thus the same builder can be used to more than one object


Method Summary
 T build()
          Returns the built object.
 

Method Detail

build

T build()
        throws ObjectUnderConstructionException
Returns the built object.

This method may be invoked more than once. Thus, it will never throw a BuilderAlreadyUsedException

If the built object of type T is modifiable, invocations to this method must return always new instances of the object under construction. Otherwise, and if configuration has not changed between two different invocation the builder that case, is ok to return the same instance than in the previous invocation, but it is not a requirement.

Specified by:
build in interface Builder<T>
Returns:
The built object.
Throws:
ObjectUnderConstructionException - as defined in Builder
See Also:
Builder.build()


Copyright © 2010-2012 Staccatocommons. All Rights Reserved.