net.java.trueupdate.util.builder
Class AbstractBuilder<P>
java.lang.Object
net.java.trueupdate.util.builder.AbstractBuilder<P>
- Type Parameters:
P - The type of the parent builder, if defined.
- Direct Known Subclasses:
- ImmutableListBuilder
public abstract class AbstractBuilder<P>
- extends Object
An abstract builder.
Note that builders are not thread-safe.
- Author:
- Christian Schlichtherle
|
Method Summary |
abstract Object |
build()
Builds and returns a new product. |
P |
inject()
Optional operation: Injects a new product into the parent builder,
if defined. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractBuilder
public AbstractBuilder()
build
public abstract Object build()
- Builds and returns a new product.
A call to this method does not alter the state of this builder,
so a client can continue to use it in order to build another product.
inject
public P inject()
- Optional operation: Injects a new product into the parent builder,
if defined.
- Throws:
UnsupportedOperationException - if this builder does not have a
parent builder.
Copyright © 2013 Schlichtherle IT Services. All rights reserved.