|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.joda.beans.impl.BufferingBeanBuilder<T>
T - the bean typepublic class BufferingBeanBuilder<T extends Bean>
Implementation of BeanBuilder that buffers data in a local map.
This is useful for cases where the builder data might be manipulated before the final build. The buffer can be directly mutated.
| Constructor Summary | |
|---|---|
BufferingBeanBuilder(MetaBean metaBean)
Constructs the builder wrapping the target bean. |
|
| Method Summary | |
|---|---|
T |
build()
Builds the bean from the state of the builder. |
Object |
get(MetaProperty<?> metaProperty)
Gets the buffered value associated with the specified property name. |
Object |
get(String propertyName)
Gets the buffered value associated with the specified property name. |
ConcurrentMap<MetaProperty<?>,Object> |
getBuffer()
Gets the buffer holding the state of the builder. |
MetaBean |
getMetaBean()
Gets the meta-beans. |
static BufferingBeanBuilder<?> |
of(MetaBean metaBean)
Constructs the builder wrapping the target bean. |
BeanBuilder<T> |
set(MetaProperty<?> metaProperty,
Object value)
Sets the value of a single property into the builder. |
BeanBuilder<T> |
set(String propertyName,
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. |
BeanBuilder<T> |
setString(String propertyName,
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 |
| Constructor Detail |
|---|
public BufferingBeanBuilder(MetaBean metaBean)
metaBean - the target meta-bean, not null| Method Detail |
|---|
public static BufferingBeanBuilder<?> of(MetaBean metaBean)
metaBean - the target meta-bean, not null
public MetaBean getMetaBean()
public ConcurrentMap<MetaProperty<?>,Object> getBuffer()
The buffer may be mutated.
public Object get(String propertyName)
get in interface BeanBuilder<T extends Bean>propertyName - the property name, not null
public Object get(MetaProperty<?> metaProperty)
get in interface BeanBuilder<T extends Bean>metaProperty - the meta-property, not null
public BeanBuilder<T> set(String propertyName,
Object value)
BeanBuilder
This will normally behave as per a Map, however it may not
and as a general rule callers should only set each property once.
set in interface BeanBuilder<T extends Bean>propertyName - the property name to set, not nullvalue - the property value, may be null
this, for chaining, not null
public BeanBuilder<T> set(MetaProperty<?> metaProperty,
Object value)
BeanBuilder
This will normally behave as per a Map, however it may not
and as a general rule callers should only set each property once.
set in interface BeanBuilder<T extends Bean>metaProperty - the meta-property to set, not nullvalue - the property value, may be null
this, for chaining, not null
public BeanBuilder<T> setString(String propertyName,
String value)
BeanBuilderThis 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.
setString in interface BeanBuilder<T extends Bean>propertyName - the property name to set, not nullvalue - the property value, may be null
this, for chaining, not null
public BeanBuilder<T> setString(MetaProperty<?> metaProperty,
String value)
BeanBuilderThis 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.
setString in interface BeanBuilder<T extends Bean>metaProperty - the meta-property name to set, not nullvalue - the property value, may be null
this, for chaining, not nullpublic BeanBuilder<T> setAll(Map<String,? extends Object> propertyValueMap)
BeanBuilder
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.
setAll in interface BeanBuilder<T extends Bean>propertyValueMap - the property name to value map, not null
this, for chaining, not nullpublic T build()
BeanBuilderOnce this method has been called, the builder is in an invalid state. The effect of further method calls is undetermined.
build in interface BeanBuilder<T extends Bean>public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||