K
- The type of the fixed keyV
- The type of the valuepublic final class FixedKeyRecord<K,V> extends Object
FixedKeyProcessor
or a record to forward to downstream processors via FixedKeyProcessorContext
.
This class encapsulates all the data attributes of a record: the key and value, but
also the timestamp of the record and any record headers.
Though key is not allowed to be changes.
This class is immutable, though the objects referenced in the attributes of this class
may themselves be mutable.Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
int |
hashCode() |
org.apache.kafka.common.header.Headers |
headers()
The headers of the record.
|
K |
key()
The key of the record.
|
long |
timestamp()
The timestamp of the record.
|
String |
toString() |
V |
value()
The value of the record.
|
FixedKeyRecord<K,V> |
withHeaders(org.apache.kafka.common.header.Headers headers)
A convenient way to produce a new record if you only need to change the headers.
|
FixedKeyRecord<K,V> |
withTimestamp(long timestamp)
A convenient way to produce a new record if you only need to change the timestamp.
|
<NewV> FixedKeyRecord<K,NewV> |
withValue(NewV value)
A convenient way to produce a new record if you only need to change the value.
|
public K key()
public V value()
public long timestamp()
public org.apache.kafka.common.header.Headers headers()
public <NewV> FixedKeyRecord<K,NewV> withValue(NewV value)
NewV
- The type of the new record's value.value
- The value of the result record.public FixedKeyRecord<K,V> withTimestamp(long timestamp)
timestamp
- The timestamp of the result record.public FixedKeyRecord<K,V> withHeaders(org.apache.kafka.common.header.Headers headers)
FixedKeyProcessorContext.forward(FixedKeyRecord)
for
considerations around mutability of keys, values, and headers.headers
- The headers of the result record.