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()@com.hivemq.extension.sdk.api.annotations.NotNull byte[]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
@NotNull @com.hivemq.extension.sdk.api.annotations.NotNull byte[] 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.
StandardCharsets.UTF_8is used for the decoding. - Since:
- 4.4.0
-
-