public class TestRecord<K,V> extends Object
TopologyTestDriver
.
If [a] record does not contain a timestamp,
TestInputTopic
will auto advance it's time when the record is piped.Constructor and Description |
---|
TestRecord(org.apache.kafka.clients.consumer.ConsumerRecord<K,V> record)
Create a
TestRecord from a ConsumerRecord . |
TestRecord(K key,
V value)
Creates a record.
|
TestRecord(K key,
V value,
org.apache.kafka.common.header.Headers headers)
Creates a record.
|
TestRecord(K key,
V value,
org.apache.kafka.common.header.Headers headers,
Instant recordTime)
Creates a record.
|
TestRecord(K key,
V value,
org.apache.kafka.common.header.Headers headers,
Long timestampMs)
Creates a record.
|
TestRecord(K key,
V value,
Instant recordTime)
Creates a record.
|
TestRecord(org.apache.kafka.clients.producer.ProducerRecord<K,V> record)
Create a
TestRecord from a ProducerRecord . |
TestRecord(V value)
Create a record with
null key. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
org.apache.kafka.common.header.Headers |
getHeaders() |
K |
getKey() |
Instant |
getRecordTime() |
V |
getValue() |
int |
hashCode() |
org.apache.kafka.common.header.Headers |
headers() |
K |
key() |
Long |
timestamp() |
String |
toString() |
V |
value() |
public TestRecord(K key, V value, org.apache.kafka.common.header.Headers headers, Instant recordTime)
key
- The key that will be included in the recordvalue
- The value of the recordheaders
- the record headers that will be included in the recordrecordTime
- The timestamp of the record.public TestRecord(K key, V value, org.apache.kafka.common.header.Headers headers, Long timestampMs)
key
- The key that will be included in the recordvalue
- The value of the recordheaders
- the record headers that will be included in the recordtimestampMs
- The timestamp of the record, in milliseconds since the beginning of the epoch.public TestRecord(K key, V value, Instant recordTime)
key
- The key of the recordvalue
- The value of the recordrecordTime
- The timestamp of the record as Instant.public TestRecord(K key, V value, org.apache.kafka.common.header.Headers headers)
key
- The key of the recordvalue
- The value of the recordheaders
- The record headers that will be included in the recordpublic TestRecord(K key, V value)
key
- The key of the recordvalue
- The value of the recordpublic TestRecord(V value)
null
key.value
- The value of the recordpublic TestRecord(org.apache.kafka.clients.consumer.ConsumerRecord<K,V> record)
TestRecord
from a ConsumerRecord
.record
- The vpublic org.apache.kafka.common.header.Headers headers()
public K key()
null
if no key is specified).public V value()
public Long timestamp()
public org.apache.kafka.common.header.Headers getHeaders()
public K getKey()
public V getValue()
public Instant getRecordTime()