You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Pascal Schumacher (JIRA)" <ji...@apache.org> on 2016/05/28 11:37:12 UTC

[jira] [Commented] (LANG-1204) Make Pairs JSON serializable (e.g. with Jackson annotations)

    [ https://issues.apache.org/jira/browse/LANG-1204?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15305315#comment-15305315 ] 

Pascal Schumacher commented on LANG-1204:
-----------------------------------------

Commons-lang has no dependencies, so Jackson or anything similar can not be used.

Pairs are already serializable, e.g. this works:

{code:java}
Gson gson = new Gson();

ImmutablePair immutablePair = new ImmutablePair("left", "right");
String immutablePairAsString = gson.toJson(immutablePair);

assertEquals(immutablePair, gson.fromJson(immutablePairAsString, ImmutablePair.class));

MutablePair mutablePair = new MutablePair("left", "right");
String mutablePairAsString = gson.toJson(mutablePair);

assertEquals(mutablePair, gson.fromJson(mutablePairAsString, MutablePair.class));
{code}

so I'm not sure there is anything we can do.

> Make Pairs JSON serializable (e.g. with Jackson annotations)
> ------------------------------------------------------------
>
>                 Key: LANG-1204
>                 URL: https://issues.apache.org/jira/browse/LANG-1204
>             Project: Commons Lang
>          Issue Type: Improvement
>            Reporter: Andrew Pennebaker
>
> Please make Pairs JSON-serializable, so that they can be used as fields in larger JSON-serializable objects.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)