Class JacksonMapping
- java.lang.Object
-
- io.smallrye.reactive.messaging.json.JacksonMapping
-
- All Implemented Interfaces:
JsonMapping
@ApplicationScoped @Priority(500) public class JacksonMapping extends Object implements JsonMapping
-
-
Field Summary
-
Fields inherited from interface io.smallrye.reactive.messaging.json.JsonMapping
DEFAULT_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description JacksonMapping()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> T
fromJson(String str, Class<T> type)
Deserialize an object from it's JSON string representation.String
toJson(Object object)
Serialize an object to JSON.
-
-
-
Method Detail
-
toJson
public String toJson(Object object)
Description copied from interface:JsonMapping
Serialize an object to JSON.- Specified by:
toJson
in interfaceJsonMapping
- Parameters:
object
- object to serialize- Returns:
- JSON representation of the object
-
fromJson
public <T> T fromJson(String str, Class<T> type)
Description copied from interface:JsonMapping
Deserialize an object from it's JSON string representation.- Specified by:
fromJson
in interfaceJsonMapping
- Type Parameters:
T
- generic parametrization class- Parameters:
str
- JSON stringtype
- type of object- Returns:
- object of requested class
-
-