Package com.avoka.fc.core.stream
Class StreamRecord<T>
java.lang.Object
com.avoka.fc.core.stream.StreamRecord<T>
- Type Parameters:
T
- the type of the value in the record
Provide a record in a stream, containing topic, key, value, partition, and offset information.
- Since:
- 24.4.0
-
Constructor Summary
ConstructorDescriptionStreamRecord
(String topic, Integer partition, String key, T value) Constructs a stream record with the given topic, partition, key, and value.StreamRecord
(String topic, String partition, String key, T value) Constructs a stream record with the given topic, key, and value. -
Method Summary
Modifier and TypeMethodDescriptiongetKey()
Retrieves the key of the record.Retrieves the offset of the record.Retrieves the partition of the record.getTopic()
Retrieves the topic of the partition.getValue()
Retrieves the value of the record.Sets the offset of the record.Sets the offset of the record.toString()
Retrieves the string representation of the stream record.static String
toString
(List<StreamRecord<?>> records) Converts a list of stream records into a string representation.
-
Constructor Details
-
StreamRecord
Constructs a stream record with the given topic, key, and value.- Parameters:
topic
- the topic of the recordkey
- the key of the recordvalue
- the value of the record
-
StreamRecord
Constructs a stream record with the given topic, partition, key, and value.- Parameters:
topic
- the topic of the recordpartition
- the partition of the recordkey
- the key of the recordvalue
- the value of the record
-
-
Method Details
-
toString
Converts a list of stream records into a string representation.- Parameters:
records
- the list of stream records- Returns:
- the string representation of the records
-
getKey
Retrieves the key of the record.- Returns:
- the key of the record
-
getValue
Retrieves the value of the record.- Returns:
- the value of the record
-
getPartition
Retrieves the partition of the record.- Returns:
- the partition of the record
-
getTopic
Retrieves the topic of the partition.- Returns:
- the topic of the partition
-
getOffset
Retrieves the offset of the record.- Returns:
- the offset of the record
-
setOffset
Sets the offset of the record.- Parameters:
offset
- the offset to set- Returns:
- the updated stream record
-
setOffset
Sets the offset of the record.- Parameters:
offset
- the offset to set- Returns:
- the updated stream record
-
toString
Retrieves the string representation of the stream record.
-