juneau-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Bognar (Jira)" <j...@apache.org>
Subject [jira] [Created] (JUNEAU-231) Simplified PojoSwaps using functions
Date Thu, 21 May 2020 12:48:00 GMT
James Bognar created JUNEAU-231:
-----------------------------------

             Summary: 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


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.3.4#803005)

Mime
View raw message