TrueUpdate Utilities 0.4

net.java.trueupdate.util.builder
Class AbstractBuilder<P>

java.lang.Object
  extended by 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

Constructor Summary
AbstractBuilder()
           
 
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
 

Constructor Detail

AbstractBuilder

public AbstractBuilder()
Method Detail

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.

TrueUpdate Utilities 0.4

Copyright © 2013 Schlichtherle IT Services. All rights reserved.