blob: 7357dd7fe7b3e9d78a6bb3ef423e56335cca9739 [file] [log] [blame]
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (21) -->
<title>ValueMapperWithKey (kafka 4.0.1 API)</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="description" content="declaration: package: org.apache.kafka.streams.kstream, interface: ValueMapperWithKey">
<meta name="generator" content="javadoc/ClassWriterImpl">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../../script-dir/jquery-ui.min.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
<script type="text/javascript" src="../../../../../script-dir/jquery-3.7.1.min.js"></script>
<script type="text/javascript" src="../../../../../script-dir/jquery-ui.min.js"></script>
</head>
<body class="class-declaration-page">
<script type="text/javascript">var pathtoroot = "../../../../../";
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<div class="flex-box">
<header role="banner" class="flex-header">
<nav role="navigation">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="top-nav" id="navbar-top"><button id="navbar-toggle-button" aria-controls="navbar-top" aria-expanded="false" aria-label="Toggle navigation links"><span class="nav-bar-toggle-icon">&nbsp;</span><span class="nav-bar-toggle-icon">&nbsp;</span><span class="nav-bar-toggle-icon">&nbsp;</span></button>
<div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div>
<ul id="navbar-top-firstrow" class="nav-list" title="Navigation">
<li><a href="../../../../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="nav-bar-cell1-rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html#class">Help</a></li>
</ul>
<ul class="sub-nav-list-small">
<li>
<p>Summary:</p>
<ul>
<li>Nested</li>
<li>Field</li>
<li>Constr</li>
<li><a href="#method-summary">Method</a></li>
</ul>
</li>
<li>
<p>Detail:</p>
<ul>
<li>Field</li>
<li>Constr</li>
<li><a href="#method-detail">Method</a></li>
</ul>
</li>
</ul>
</div>
<div class="sub-nav">
<div id="navbar-sub-list">
<ul class="sub-nav-list">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method-summary">Method</a></li>
</ul>
<ul class="sub-nav-list">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method-detail">Method</a></li>
</ul>
</div>
<div class="nav-list-search"><a href="../../../../../search.html">SEARCH</a>
<input type="text" id="search-input" disabled placeholder="Search">
<input type="reset" id="reset-button" disabled value="reset">
</div>
</div>
<!-- ========= END OF TOP NAVBAR ========= -->
<span class="skip-nav" id="skip-navbar-top"></span></nav>
</header>
<div class="flex-content">
<main role="main">
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="sub-title"><span class="package-label-in-type">Package</span>&nbsp;<a href="package-summary.html">org.apache.kafka.streams.kstream</a></div>
<h1 title="Interface ValueMapperWithKey" class="title">Interface ValueMapperWithKey&lt;K,<wbr>V,<wbr>VR&gt;</h1>
</div>
<section class="class-description" id="class-description">
<dl class="notes">
<dt>Type Parameters:</dt>
<dd><code>K</code> - key type</dd>
<dd><code>V</code> - value type</dd>
<dd><code>VR</code> - mapped value type</dd>
</dl>
<hr>
<div class="type-signature"><span class="modifiers">public interface </span><span class="element-name type-name-label">ValueMapperWithKey&lt;K,<wbr>V,<wbr>VR&gt;</span></div>
<div class="block">The <code>ValueMapperWithKey</code> interface for mapping a value to a new value of arbitrary type.
This is a stateless record-by-record operation, i.e, <a href="#apply(K,V)"><code>apply(Object, Object)</code></a> is invoked individually for each
record of a stream (cf. <a href="../processor/api/FixedKeyProcessor.html" title="interface in org.apache.kafka.streams.processor.api"><code>FixedKeyProcessor</code></a> for stateful value transformation).
If <code>ValueMapperWithKey</code> is applied to a <a href="../processor/api/Record.html" title="class in org.apache.kafka.streams.processor.api"><code>Record</code></a> the
record's key is preserved.
Note that the key is read-only and should not be modified, as this can lead to corrupt partitioning.
If a record's key and value should be modified <a href="KeyValueMapper.html" title="interface in org.apache.kafka.streams.kstream"><code>KeyValueMapper</code></a> can be used.</div>
<dl class="notes">
<dt>See Also:</dt>
<dd>
<ul class="tag-list-long">
<li><a href="KeyValueMapper.html" title="interface in org.apache.kafka.streams.kstream"><code>KeyValueMapper</code></a></li>
<li><a href="../processor/api/FixedKeyProcessor.html" title="interface in org.apache.kafka.streams.processor.api"><code>FixedKeyProcessor</code></a></li>
<li><a href="KStream.html#mapValues(org.apache.kafka.streams.kstream.ValueMapper)"><code>KStream.mapValues(ValueMapper)</code></a></li>
<li><a href="KStream.html#mapValues(org.apache.kafka.streams.kstream.ValueMapperWithKey)"><code>KStream.mapValues(ValueMapperWithKey)</code></a></li>
<li><a href="KStream.html#flatMapValues(org.apache.kafka.streams.kstream.ValueMapper)"><code>KStream.flatMapValues(ValueMapper)</code></a></li>
<li><a href="KStream.html#flatMapValues(org.apache.kafka.streams.kstream.ValueMapperWithKey)"><code>KStream.flatMapValues(ValueMapperWithKey)</code></a></li>
<li><a href="KTable.html#mapValues(org.apache.kafka.streams.kstream.ValueMapper)"><code>KTable.mapValues(ValueMapper)</code></a></li>
<li><a href="KTable.html#mapValues(org.apache.kafka.streams.kstream.ValueMapperWithKey)"><code>KTable.mapValues(ValueMapperWithKey)</code></a></li>
</ul>
</dd>
</dl>
</section>
<section class="summary">
<ul class="summary-list">
<!-- ========== METHOD SUMMARY =========== -->
<li>
<section class="method-summary" id="method-summary">
<h2>Method Summary</h2>
<div id="method-summary-table">
<div class="table-tabs" role="tablist" aria-orientation="horizontal"><button id="method-summary-table-tab0" role="tab" aria-selected="true" aria-controls="method-summary-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table', 3)" class="active-table-tab">All Methods</button><button id="method-summary-table-tab2" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab2', 3)" class="table-tab">Instance Methods</button><button id="method-summary-table-tab3" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab3', 3)" class="table-tab">Abstract Methods</button></div>
<div id="method-summary-table.tabpanel" role="tabpanel" aria-labelledby="method-summary-table-tab0">
<div class="summary-table three-column-summary">
<div class="table-header col-first">Modifier and Type</div>
<div class="table-header col-second">Method</div>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="ValueMapperWithKey.html" title="type parameter in ValueMapperWithKey">VR</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#apply(K,V)" class="member-name-link">apply</a><wbr>(<a href="ValueMapperWithKey.html" title="type parameter in ValueMapperWithKey">K</a>&nbsp;readOnlyKey,
<a href="ValueMapperWithKey.html" title="type parameter in ValueMapperWithKey">V</a>&nbsp;value)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Map the given [key and ]value to a new value.</div>
</div>
</div>
</div>
</div>
</section>
</li>
</ul>
</section>
<section class="details">
<ul class="details-list">
<!-- ============ METHOD DETAIL ========== -->
<li>
<section class="method-details" id="method-detail">
<h2>Method Details</h2>
<ul class="member-list">
<li>
<section class="detail" id="apply(K,V)">
<h3 id="apply(java.lang.Object,java.lang.Object)">apply</h3>
<div class="member-signature"><span class="return-type"><a href="ValueMapperWithKey.html" title="type parameter in ValueMapperWithKey">VR</a></span>&nbsp;<span class="element-name">apply</span><wbr><span class="parameters">(<a href="ValueMapperWithKey.html" title="type parameter in ValueMapperWithKey">K</a>&nbsp;readOnlyKey,
<a href="ValueMapperWithKey.html" title="type parameter in ValueMapperWithKey">V</a>&nbsp;value)</span></div>
<div class="block">Map the given [key and ]value to a new value.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>readOnlyKey</code> - the read-only key</dd>
<dd><code>value</code> - the value to be mapped</dd>
<dt>Returns:</dt>
<dd>the new value</dd>
</dl>
</section>
</li>
</ul>
</section>
</li>
</ul>
</section>
<!-- ========= END OF CLASS DATA ========= -->
</main>
</div>
</div>
</body>
</html>