org.qi4j.api.value
Interface ValueBuilder<T>

All Superinterfaces:
Iterable<T>

public interface ValueBuilder<T>
extends Iterable<T>

JAVADOC


Method Summary
 T newInstance()
          Create a new Composite instance.
 T prototype()
          Get a representation of the state for the new Value.
<K> K
prototypeFor(Class<K> mixinType)
          Get a representation of the state of the given type for the new ValueComposite.
 ValueBuilder<T> withPrototype(T value)
          Use given value as prototype for this value builder.
 ValueBuilder<T> withState(StateHolder state)
           
 
Methods inherited from interface java.lang.Iterable
iterator
 

Method Detail

withPrototype

ValueBuilder<T> withPrototype(T value)
Use given value as prototype for this value builder.

Parameters:
value - whose state should be copied to this builder
Returns:
the builder itself

withState

ValueBuilder<T> withState(StateHolder state)

prototype

T prototype()
Get a representation of the state for the new Value. It is possible to access and update properties and associations, even immutable ones since the builder represents the initial state.

Returns:
a mutable instance of the Value type

prototypeFor

<K> K prototypeFor(Class<K> mixinType)
Get a representation of the state of the given type for the new ValueComposite. This is primarily used if you want to provide state for a private mixin type.

Parameters:
mixinType - the mixin which you want to provide state for
Returns:
a proxy implementing the given mixin type

newInstance

T newInstance()
              throws ConstructionException
Create a new Composite instance.

Returns:
a new Composite instance
Throws:
ConstructionException - thrown if it was not possible to instantiate the Composite