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 Details

    • SchemaProjector

      public SchemaProjector()
  • Method Details

    • project

      public static Object project(Schema source, Object record, Schema target) throws SchemaProjectorException
      This method project a value between compatible schemas and throw exceptions when non compatible schemas are provided
      Parameters:
      source - the schema used to construct the record
      record - the value to project from source schema to target schema
      target - the schema to project the record to
      Returns:
      the projected value with target schema
      Throws:
      SchemaProjectorException - if the target schema is not optional and does not have a default value