6153 |
28 Sep 12 |
nicklas |
1 |
/** |
6153 |
28 Sep 12 |
nicklas |
$Id $ |
6153 |
28 Sep 12 |
nicklas |
3 |
|
6153 |
28 Sep 12 |
nicklas |
Copyright (C) 2012 Nicklas Nordborg |
6153 |
28 Sep 12 |
nicklas |
5 |
|
6153 |
28 Sep 12 |
nicklas |
This file is part of BASE - BioArray Software Environment. |
6153 |
28 Sep 12 |
nicklas |
Available at http://base.thep.lu.se/ |
6153 |
28 Sep 12 |
nicklas |
8 |
|
6153 |
28 Sep 12 |
nicklas |
BASE is free software; you can redistribute it and/or |
6153 |
28 Sep 12 |
nicklas |
modify it under the terms of the GNU General Public License |
6153 |
28 Sep 12 |
nicklas |
as published by the Free Software Foundation; either version 3 |
6153 |
28 Sep 12 |
nicklas |
of the License, or (at your option) any later version. |
6153 |
28 Sep 12 |
nicklas |
13 |
|
6153 |
28 Sep 12 |
nicklas |
BASE is distributed in the hope that it will be useful, |
6153 |
28 Sep 12 |
nicklas |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
6153 |
28 Sep 12 |
nicklas |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
6153 |
28 Sep 12 |
nicklas |
GNU General Public License for more details. |
6153 |
28 Sep 12 |
nicklas |
18 |
|
6153 |
28 Sep 12 |
nicklas |
You should have received a copy of the GNU General Public License |
6153 |
28 Sep 12 |
nicklas |
along with BASE. If not, see <http://www.gnu.org/licenses/>. |
6153 |
28 Sep 12 |
nicklas |
21 |
*/ |
6153 |
28 Sep 12 |
nicklas |
22 |
package net.sf.basedb.util.json; |
6153 |
28 Sep 12 |
nicklas |
23 |
|
6153 |
28 Sep 12 |
nicklas |
24 |
|
6153 |
28 Sep 12 |
nicklas |
25 |
/** |
6153 |
28 Sep 12 |
nicklas |
Simple "converter" implementation that simply return the same object. |
6153 |
28 Sep 12 |
nicklas |
27 |
|
6153 |
28 Sep 12 |
nicklas |
@author nicklas |
6153 |
28 Sep 12 |
nicklas |
@since 3.3 |
6153 |
28 Sep 12 |
nicklas |
30 |
*/ |
6153 |
28 Sep 12 |
nicklas |
31 |
public class IdentityConverter<T> |
6153 |
28 Sep 12 |
nicklas |
32 |
implements JsonConverter<T> |
6153 |
28 Sep 12 |
nicklas |
33 |
{ |
6153 |
28 Sep 12 |
nicklas |
34 |
|
6153 |
28 Sep 12 |
nicklas |
35 |
public IdentityConverter() |
6153 |
28 Sep 12 |
nicklas |
36 |
{} |
6153 |
28 Sep 12 |
nicklas |
37 |
|
6153 |
28 Sep 12 |
nicklas |
38 |
/** |
6153 |
28 Sep 12 |
nicklas |
@return The parameter |
6153 |
28 Sep 12 |
nicklas |
40 |
*/ |
6153 |
28 Sep 12 |
nicklas |
41 |
@Override |
6153 |
28 Sep 12 |
nicklas |
42 |
public Object convert(T object) |
6153 |
28 Sep 12 |
nicklas |
43 |
{ |
6153 |
28 Sep 12 |
nicklas |
44 |
return object; |
6153 |
28 Sep 12 |
nicklas |
45 |
} |
6153 |
28 Sep 12 |
nicklas |
46 |
|
6153 |
28 Sep 12 |
nicklas |
47 |
} |