Package org.apache.kafka.connect.data
Class SchemaProjector
java.lang.Object
org.apache.kafka.connect.data.SchemaProjector
public class SchemaProjector extends Object
SchemaProjector is utility to project a value between compatible schemas and throw exceptions when non compatible schemas are provided.
-
Constructor Summary
Constructors Constructor Description SchemaProjector()
-
Method Summary
-
Constructor Details
-
SchemaProjector
public SchemaProjector()
-
-
Method Details
-
project
public static Object project(Schema source, Object record, Schema target) throws SchemaProjectorExceptionThis method project a value between compatible schemas and throw exceptions when non compatible schemas are provided- Parameters:
source
- the schema used to construct the recordrecord
- the value to project from source schema to target schematarget
- the schema to project the record to- Returns:
- the projected value with target schema
- Throws:
SchemaProjectorException
-