org.joda.beans.impl.direct
Class DirectFieldsBeanBuilder<T extends Bean>

java.lang.Object
  extended by org.joda.beans.impl.direct.DirectFieldsBeanBuilder<T>
Type Parameters:
T - the bean type
All Implemented Interfaces:
BeanBuilder<T>

public abstract class DirectFieldsBeanBuilder<T extends Bean>
extends Object
implements BeanBuilder<T>

A builder implementation designed for use by the code generator.

This implementation is intended to have fields generated in the subclass.


Constructor Summary
protected DirectFieldsBeanBuilder()
          Constructs the builder.
 
Method Summary
 BeanBuilder<T> set(MetaProperty<?> metaProperty, Object value)
          Sets the value of a single property into the builder.
 BeanBuilder<T> setAll(Map<String,? extends Object> propertyValueMap)
          Sets the value of a map of properties into the builder.
 BeanBuilder<T> setString(MetaProperty<?> metaProperty, String value)
          Sets the value of a single property into the builder.
 String toString()
          Returns a string that summarises the builder.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.joda.beans.BeanBuilder
build, set, setString
 

Constructor Detail

DirectFieldsBeanBuilder

protected DirectFieldsBeanBuilder()
Constructs the builder.

Method Detail

set

public BeanBuilder<T> set(MetaProperty<?> metaProperty,
                          Object value)
Description copied from interface: BeanBuilder
Sets the value of a single property into the builder.

This will normally behave as per a Map, however it may not and as a general rule callers should only set each property once.

Specified by:
set in interface BeanBuilder<T extends Bean>
Parameters:
metaProperty - the meta-property, not null
value - the property value, may be null
Returns:
this, for chaining, not null

setString

public BeanBuilder<T> setString(MetaProperty<?> metaProperty,
                                String value)
Description copied from interface: BeanBuilder
Sets the value of a single property into the builder.

This converts the string to the correct type for the property. Conversion uses Joda-Convert.

This will normally behave as per a Map, however it may not and as a general rule callers should only set each property once.

Specified by:
setString in interface BeanBuilder<T extends Bean>
Parameters:
metaProperty - the meta-property name, not null
value - the property value, may be null
Returns:
this, for chaining, not null

setAll

public BeanBuilder<T> setAll(Map<String,? extends Object> propertyValueMap)
Description copied from interface: BeanBuilder
Sets the value of a map of properties into the builder.

Each map entry is used as the input to BeanBuilder.set(String, Object).

This will normally behave as per a Map, however it may not and as a general rule callers should only set each property once.

Specified by:
setAll in interface BeanBuilder<T extends Bean>
Parameters:
propertyValueMap - the property name to value map, not null
Returns:
this, for chaining, not null

toString

public String toString()
Returns a string that summarises the builder.

Overrides:
toString in class Object
Returns:
a summary string, not null


Copyright © 2007–2014 Joda.org. All rights reserved.