Package org.europa.together.business
Interface JsonTools<T>
- Type Parameters:
T
- as DomainObject
- All Known Implementing Classes:
JacksonJsonTools
@API(status=STABLE,
since="3.0",
consumers="JacksonJsonTools")
@Component
public interface JsonTools<T>
Lightweight wrapper for basic JSON functionality.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptiondeserializeJsonAsList
(String json) Create (deserialize) a list of DomainObject >T< from a JSON String.deserializeJsonAsObject
(String json, Class<T> object) Create (deserialize) a DomainObject >T< from a JSON String.serializeAsJsonObject
(T object) Serialize an DomainObject >T< to an JSON String.
-
Field Details
-
FEATURE_ID
Identifier for the given feature.- See Also:
-
-
Method Details
-
serializeAsJsonObject
@API(status=STABLE, since="3.0") String serializeAsJsonObject(T object) throws JsonProcessingException Serialize an DomainObject >T< to an JSON String.- Parameters:
object
- as >T< DomainObject- Returns:
- JSON as String
- Throws:
JsonProcessingException
-
deserializeJsonAsObject
@API(status=STABLE, since="3.0") T deserializeJsonAsObject(String json, Class<T> object) throws JsonProcessingException, ClassNotFoundException Create (deserialize) a DomainObject >T< from a JSON String.- Parameters:
json
- as Stringobject
- as >T<- Returns:
- DomainObject as >T<
- Throws:
JsonProcessingException
ClassNotFoundException
-
deserializeJsonAsList
@API(status=STABLE, since="3.0") List<T> deserializeJsonAsList(String json) throws JsonProcessingException, ClassNotFoundException Create (deserialize) a list of DomainObject >T< from a JSON String.- Parameters:
json
- as String- Returns:
- List of DomainObjects as >T<
- Throws:
JsonProcessingException
ClassNotFoundException
-