Package org.apache.kafka.connect.header
Interface Header
public interface Header
-
Method Summary
Modifier and Type Method Description String
key()
The header's key, which is not necessarily unique within the set of headers on a Kafka message.Header
rename(String key)
Return a newHeader
object that has the same schema and value but with the supplied key.Schema
schema()
Return theSchema
associated with this header, if there is one.Object
value()
Get the header's value as deserialized by Connect's header converter.Header
with(Schema schema, Object value)
Return a newHeader
object 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 theSchema
associated 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 newHeader
object 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 newHeader
object 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
-