Package org.apache.kafka.connect.header
Interface Header
public interface Header
-
Method Summary
Modifier and TypeMethodDescriptionkey()The header's key, which is not necessarily unique within the set of headers on a Kafka message.Return a newHeaderobject that has the same schema and value but with the supplied key.schema()Return theSchemaassociated with this header, if there is one.value()Get the header's value as deserialized by Connect's header converter.Return a newHeaderobject that has the same key but with the supplied value.
-
Method Details
-
key
String key()The header's key, which is not necessarily unique within the set of headers on a Kafka message.- Returns:
- the header's key; never null
-
schema
Schema schema()Return theSchemaassociated with this header, if there is one. Not all headers will have schemas.- Returns:
- the header's schema, or null if no schema is associated with this header
-
value
Object value()Get the header's value as deserialized by Connect's header converter.- Returns:
- the deserialized object representation of the header's value; may be null
-
with
Return a newHeaderobject that has the same key but with the supplied value.- Parameters:
schema- the schema for the new value; may be nullvalue- the new value- Returns:
- the new
Header; never null
-
rename
Return a newHeaderobject that has the same schema and value but with the supplied key.- Parameters:
key- the key for the new header; may not be null- Returns:
- the new
Header; never null
-