public class TestRecord<K,V>
extends java.lang.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,
java.time.Instant recordTime)
Creates a record.
|
TestRecord(K key,
V value,
org.apache.kafka.common.header.Headers headers,
java.lang.Long timestampMs)
Creates a record.
|
TestRecord(K key,
V value,
java.time.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(java.lang.Object o) |
org.apache.kafka.common.header.Headers |
getHeaders() |
K |
getKey() |
java.time.Instant |
getRecordTime() |
V |
getValue() |
int |
hashCode() |
org.apache.kafka.common.header.Headers |
headers() |
K |
key() |
java.lang.Long |
timestamp() |
java.lang.String |
toString() |
V |
value() |
public TestRecord(K key, V value, org.apache.kafka.common.header.Headers headers, java.time.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, java.lang.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, java.time.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 java.lang.Long timestamp()
public org.apache.kafka.common.header.Headers getHeaders()
public K getKey()
public V getValue()
public java.time.Instant getRecordTime()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object