Class AbstractStub
java.lang.Object
de.aristaflow.ilm.ws.rest.base.service.AbstractStub
- Direct Known Subclasses:
AbstractRestStub,AbstractSseStub
This class provides the basic means for making REST callback calls
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractStub(Supplier<com.fasterxml.jackson.databind.ObjectMapper> om, LogService logService) Creates a new abstract stub providing the basic means for making callback calls. -
Method Summary
Modifier and TypeMethodDescription<T> StringgetJsonFor(Class<T> cls, T value) Gets the JSON representation of the designated value for the designated class.
-
Field Details
-
logger
The logger for log messages, especially data lost when throwing an exception. -
om
The object mapper (supplier) for reading JSON objects from responses (including exceptions).
-
-
Constructor Details
-
AbstractStub
protected AbstractStub(Supplier<com.fasterxml.jackson.databind.ObjectMapper> om, LogService logService) Creates a new abstract stub providing the basic means for making callback calls.- Parameters:
om- The object mapper (supplier) for reading JSON objects from responses (including exceptions).logService- The log service for creating class-specific loggers.
-
-
Method Details
-
getJsonFor
Gets the JSON representation of the designated value for the designated class.- Parameters:
cls- The class for which to get the JSON representation for an instance.value- The instance of the designated class for which the JSON representation.- Returns:
- The JSON representation for the designated value being an instance of the designated class.
- Throws:
IOException- If there are problems creating the JSON representation, anIOExceptionwill be thrown.
-