Interface KafkaHeader
-
@Immutable @DoNotImplement public interface KafkaHeader
Represents the header of a Kafka record, that was either read from or should be written to a Kafka cluster.The internal state of this interface is completely immutable. All returned
ByteBuffers are read only and a deep copy of anybyte[]is made for every method call returning one.- Since:
- 4.4.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description @NotNull StringgetKey()@NotNull ByteBuffergetValue()byte @NotNull []getValueAsByteArray()@NotNull StringgetValueAsString()@NotNull StringgetValueAsString(@NotNull Charset charset)
-
-
-
Method Detail
-
getValue
@NotNull @NotNull ByteBuffer getValue()
- Returns:
- The value of this header.
- Since:
- 4.4.0
-
getValueAsByteArray
byte @NotNull [] getValueAsByteArray()
- Returns:
- The value of this header.
- Since:
- 4.4.0
-
getValueAsString
@NotNull @NotNull String getValueAsString()
- Returns:
- The value of this header as a string.
UTF_8is used for the decoding. - Since:
- 4.4.0
-
-