Class JohnzonJsonbAdapter<JsonType,OriginalType>
- java.lang.Object
-
- org.apache.johnzon.jsonb.converter.JohnzonJsonbAdapter<JsonType,OriginalType>
-
- All Implemented Interfaces:
Adapter<OriginalType,JsonType>
,MapperConverter
,TypeAwareAdapter<OriginalType,JsonType>
public class JohnzonJsonbAdapter<JsonType,OriginalType> extends Object implements TypeAwareAdapter<OriginalType,JsonType>
-
-
Field Summary
Fields Modifier and Type Field Description private jakarta.json.bind.adapter.JsonbAdapter<OriginalType,JsonType>
delegate
private Type
from
private AdapterKey
key
private Type
to
-
Constructor Summary
Constructors Constructor Description JohnzonJsonbAdapter(jakarta.json.bind.adapter.JsonbAdapter<OriginalType,JsonType> delegate, Type from, Type to)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JsonType
from(OriginalType obj)
Take the POJO_TYPE object A from a POJO an convert it to JSON_TYPE which will be inserted into the JSON output.Type
getFrom()
AdapterKey
getKey()
Type
getTo()
OriginalType
to(JsonType obj)
Transfer JSONTYPE_TYPE from JSON to POJO as POJO_TYPE.
-
-
-
Field Detail
-
delegate
private final jakarta.json.bind.adapter.JsonbAdapter<OriginalType,JsonType> delegate
-
from
private final Type from
-
to
private final Type to
-
key
private final AdapterKey key
-
-
Constructor Detail
-
JohnzonJsonbAdapter
public JohnzonJsonbAdapter(jakarta.json.bind.adapter.JsonbAdapter<OriginalType,JsonType> delegate, Type from, Type to)
-
-
Method Detail
-
to
public OriginalType to(JsonType obj)
Description copied from interface:Adapter
Transfer JSONTYPE_TYPE from JSON to POJO as POJO_TYPE.- Specified by:
to
in interfaceAdapter<JsonType,OriginalType>
- Parameters:
obj
- the JSON type- Returns:
- the equivalent Java type
-
from
public JsonType from(OriginalType obj)
Description copied from interface:Adapter
Take the POJO_TYPE object A from a POJO an convert it to JSON_TYPE which will be inserted into the JSON output.- Specified by:
from
in interfaceAdapter<JsonType,OriginalType>
- Parameters:
obj
- the Java type- Returns:
- the equivalent JSON type
-
getKey
public AdapterKey getKey()
- Specified by:
getKey
in interfaceTypeAwareAdapter<JsonType,OriginalType>
-
getTo
public Type getTo()
- Specified by:
getTo
in interfaceTypeAwareAdapter<JsonType,OriginalType>
-
getFrom
public Type getFrom()
- Specified by:
getFrom
in interfaceTypeAwareAdapter<JsonType,OriginalType>
-
-