Skip to content

Commit

Permalink
Add javadocs
Browse files Browse the repository at this point in the history
  • Loading branch information
JakobEdding committed Apr 11, 2024
1 parent 011347e commit db41807
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,15 @@ public TestOutput<K, V> asStream() {
return new StreamOutput<>(this.testDriver, this.topic, this.keySerde, this.valueSerde);
}

/**
* Convert the output to a {@link java.util.List}. In case the current instance of this class is a
* {@link StreamOutput}, the output will be converted to List with {@link org.apache.kafka.streams.kstream.KStream}
* semantics (each key multiple times). In case the current instance of this class is a {@link TableOutput}, the
* output will be converted to List with {@link org.apache.kafka.streams.kstream.KTable} semantics (each key only
* once).
*
* @return A {@link java.util.List} representing the output
*/
@Override
public List<ProducerRecord<K, V>> toList() {
final List<ProducerRecord<K, V>> list = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,16 @@ default <VR> TestOutput<K, VR> withValueType(final Class<VR> valueType) {
* <p>This is the default, there should usually be no need to call this method.</p>
* <p>Note: once the first value of the stream has been read or the iterator has be called, you cannot switch
* between the output types any more.</p>
*
* @return Current output with {@link org.apache.kafka.streams.kstream.KStream} semantics
*/
TestOutput<K, V> asStream();

/**
* Convert the output to a {@link java.util.List}.
*
* @return A {@link java.util.List} representing the output
*/
List<ProducerRecord<K, V>> toList();
}

0 comments on commit db41807

Please sign in to comment.