Skip to content

Static transformation with a given transformer #44

Description

@fborriello

The static transformation became a widely used feature, but, as it is now, it uses a brand new Transformer (dynamically generated) without any custom configuration.

The solution I'd like
Possibility to use the static transformation feature with a given Transformer properly configured.

Describe alternatives you've considered
Alternatively, the same result can be obtained without using static transformation.

Example call

Transformer myCustomTransformer = 
                new BeanUtils().getTransformer()
                        .withFieldMapping(new FieldMapping("name", "differentName"));

Function<FromFooSimple, ImmutableToFooSimple> transformerFunction = BeanUtils.getTransformer(myCustomTransformer, ImmutableToFooSimple.class);
List<ImmutableToFooSimple> actual = fromFooSimpleList.stream()
                .map(transformerFunction)
                .collect(Collectors.toList());

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions