|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
T - the type of the beanpublic interface BeanBuilder<T extends Bean>
A builder for a bean, providing a safe way to create it.
This interface allows a bean to be created even if it is immutable.
| Method Summary | |
|---|---|
T |
build()
Builds the bean from the state of the builder. |
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. |
| Method Detail |
|---|
BeanBuilder<T> set(String propertyName,
Object value)
This will normally behave as per a Map, however it may not
and as a general rule callers should only set each property once.
propertyName - the property name, not nullvalue - the property value, may be null
this, for chaining, not null
RuntimeException - optionally thrown if the property name is invalid
BeanBuilder<T> set(MetaProperty<?> metaProperty,
Object value)
This will normally behave as per a Map, however it may not
and as a general rule callers should only set each property once.
metaProperty - the meta-property, not nullvalue - the property value, may be null
this, for chaining, not null
RuntimeException - optionally thrown if the property name is invalid
BeanBuilder<T> setString(String propertyName,
String value)
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.
propertyName - the property name, not nullvalue - the property value, may be null
this, for chaining, not null
RuntimeException - optionally thrown if the property name is invalid
BeanBuilder<T> setString(MetaProperty<?> metaProperty,
String value)
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.
metaProperty - the meta-property name, not nullvalue - the property value, may be null
this, for chaining, not null
RuntimeException - optionally thrown if the property name is invalidBeanBuilder<T> setAll(Map<String,? extends Object> propertyValueMap)
Each map entry is used as the input to 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.
propertyValueMap - the property name to value map, not null
this, for chaining, not null
RuntimeException - optionally thrown if a property name is invalidT build()
Once this method has been called, the builder is in an invalid state. The effect of further method calls is undetermined.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||