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