Interface Converter<I,O>
- Type Parameters:
I
- the input data format typeO
- the output data format type
- All Known Subinterfaces:
Inverter<T>
- All Known Implementing Classes:
AbstractConverter
,JacksonInverter
public interface Converter<I,O>
Interface for converting
Data
objects from one format or representation to another.
Converters are typically used to transform serialized data—e.g., for encoding changes, compression, encryption, or changing the representation format (such as JSON to binary).
-
Method Summary
Modifier and TypeMethodDescriptiondefault Data
<?> convertFormat
(Data<I> data) Optionally converts the structure or format (e.g.: application/json) of the input data without modifying its core content.
-
Method Details
-
convert
- Parameters:
data
- the input data- Returns:
- the converted data
-
convertFormat
Optionally converts the structure or format (e.g.: application/json) of the input data without modifying its core content.This method is used in scenarios where only a format change is required (e.g., wrapping metadata differently), and may return the original input or a modified version depending on the implementation.
- Parameters:
data
- the input data- Returns:
- the format-converted data, or the original input (default implementation)
-
getOutputType
- Returns:
- the target output type this converter produces
-