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


public interface ValueBuilder<T>

Builder for Values.


Method Summary
 T newInstance()
          Create a new Composite instance.
 T prototype()
          Get a representation of the state for the new Value.
<K> K
prototypeFor(java.lang.Class<K> mixinType)
          Get a representation of the state of the given type for the new ValueComposite.
 AssociationStateHolder state()
           
 

Method Detail

state

AssociationStateHolder 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(java.lang.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