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
ByteBuffer
s 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 String
getKey()
@NotNull ByteBuffer
getValue()
byte @NotNull []
getValueAsByteArray()
@NotNull String
getValueAsString()
@NotNull String
getValueAsString(@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_8
is used for the decoding. - Since:
- 4.4.0
-
-