Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
DozerProxyMapping prototype idea
ProxyConfigurator configurator = new ProxyConfigurator();
Mapping mapping = configurator.newMappingBuilder()
.from(User.class, (user) -> user.getRole().getName() )
.to(UserQuery.class, (query) -> query.getRoleName() )
.andReverseAlso()
.build();
configurator.addMapping(mapping);
configurator.addMapping(
configurator.newMappingBuilder()
.from(Permission.class, (permission) -> user.isGranted() )
.to(PermissionQuery.class, (query) -> query.isAccessGranted() )
.build()
);
configurator.addMapping( (builder) -> { builder
.from(Password.class, (password) -> password.getSalt() )
.useConverter(SaltConverter.class)
.to(Secret.class, (secret) -> secret.getSalts().iterator().next() )
});
configurator.configure(dozer);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.