Package nl._42.beanie
Interface EditableBeanBuildCommand<T>
- All Superinterfaces:
BeanBuildCommand<T>
Bean build command that allows users to declare custom property values.
- Since:
- Feb 14, 2014
- Author:
- Jeroen van Schagen
-
Method Summary
Modifier and TypeMethodDescription<I extends EditableBeanBuildCommand<T>,
T>
IChanges the interface type.Perform an operation on the intermediate object.generateValue
(String... propertyNames) Generate a value in our to be generated bean.generateValue
(String propertyName, ValueGenerator generator) Generate a value in our to be generated bean.Copies all usable property values from a bean into our result.<I extends EditableBeanBuildCommand<M>,
M>
ICombination of as and map, performs a mapping on the intermediate object, changing the type to the targetType and changing the EditableBeanBuild command interface.<M> EditableBeanBuildCommand<M>
Perform a mapping on the intermediate object, changing the type to targetType.Perform a mapping on the intermediate object, changing it into the result object of our function.setBeanSaver
(Function<T, T> beanSaver) Register a callback before saving the generated bean.Declare a value in our to be generated bean.Methods inherited from interface nl._42.beanie.BeanBuildCommand
construct, construct, fill, save
-
Method Details
-
withValue
Declare a value in our to be generated bean.- Parameters:
propertyName
- the property namevalue
- the property value- Returns:
- this instance, for chaining
-
load
Copies all usable property values from a bean into our result.- Parameters:
bean
- the bean to copy properties fromexclusions
- the property names to exclude from copy- Returns:
- this instance, for chaining
-
map
Perform a mapping on the intermediate object, changing it into the result object of our function.- Parameters:
function
- the function that should be performed- Returns:
- this instance, for chaining
-
map
Perform a mapping on the intermediate object, changing the type to targetType.- Type Parameters:
M
- The target class- Parameters:
targetType
- The type the intermediate object should continue to have- Returns:
- new instance of EditableBeanBuildCommand
-
map
Combination of as and map, performs a mapping on the intermediate object, changing the type to the targetType and changing the EditableBeanBuild command interface.- Type Parameters:
I
- The new EditableBeanBuildCommand interfaceM
- The target class- Parameters:
interfaceType
- The new interface type to continue withtargetType
- The type the intermediate object should continue to have- Returns:
- new instance of EditableBeanBuildCommand
-
as
Changes the interface type. This allows you to continue with another command.- Type Parameters:
I
- the interface typeT
- the bean type- Parameters:
interfaceType
- the new interface type class- Returns:
- new command instance of specified type
-
doWith
Perform an operation on the intermediate object.- Parameters:
consumer
- the consumer that should take our object- Returns:
- this instance, for chaining
-
generateValue
Generate a value in our to be generated bean.- Parameters:
propertyName
- the property namegenerator
- the value generator- Returns:
- this instance, for chaining
-
generateValue
Generate a value in our to be generated bean.- Parameters:
propertyNames
- the property names- Returns:
- this instance, for chaining
-
setBeanSaver
Register a callback before saving the generated bean.- Parameters:
beanSaver
- the bean saver- Returns:
- this instance, for chaining
-