You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@juneau.apache.org by "James Bognar (Jira)" <ji...@apache.org> on 2022/06/24 17:21:00 UTC
[jira] [Closed] (JUNEAU-231) Simplified PojoSwaps using functions
[ https://issues.apache.org/jira/browse/JUNEAU-231?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
James Bognar closed JUNEAU-231.
-------------------------------
Resolution: Fixed
Implemented in 9.0.0
> Simplified PojoSwaps using functions
> ------------------------------------
>
> Key: JUNEAU-231
> URL: https://issues.apache.org/jira/browse/JUNEAU-231
> Project: Juneau
> Issue Type: Improvement
> Components: Code
> Affects Versions: 8.1.3
> Reporter: James Bognar
> Priority: Major
>
> It would be useful to be able to create PojoSwaps using a functional interface. Something like this:
> {code:java}
> JsonSerializer s = JsonSerializer
> .create()
> .pojoSwaps(
> Swaps.swap(MyBean.class, String.class, x -> x.toString()),
> Swaps.unswap(String.class, MyBean.class, x -> new MyBean(x))
> )
> .build();{code}
--
This message was sent by Atlassian Jira
(v8.20.7#820007)