blob: 4bdacff2ac43f1a3d6ddb8619eef805557a85691 [file] [log] [blame]
<!DOCTYPE HTML>
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc -->
<title>Parameter (Apache Calcite calcite API)</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="description" content="declaration: package: org.apache.calcite.linq4j.function, annotation type: Parameter">
<meta name="generator" content="javadoc/AnnotationTypeWriterImpl">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../../script-dir/jquery-ui.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
<script type="text/javascript" src="../../../../../script-dir/jszip/dist/jszip.min.js"></script>
<script type="text/javascript" src="../../../../../script-dir/jszip-utils/dist/jszip-utils.min.js"></script>
<!--[if IE]>
<script type="text/javascript" src="../../../../../script-dir/jszip-utils/dist/jszip-utils-ie.min.js"></script>
<![endif]-->
<script type="text/javascript" src="../../../../../script-dir/jquery-3.4.1.js"></script>
<script type="text/javascript" src="../../../../../script-dir/jquery-ui.js"></script>
</head>
<body class="class-declaration">
<script type="text/javascript">var pathtoroot = "../../../../../";
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<div class="flexBox">
<header role="banner" class="flexHeader">
<nav role="navigation">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a id="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">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">Help</a></li>
</ul>
<div class="aboutLanguage"><b>Apache Calcite</b></div>
</div>
<div class="subNav">
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#annotation.type.required.element.summary">Required</a>&nbsp;|&nbsp;</li>
<li><a href="#annotation.type.optional.element.summary">Optional</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#annotation.type.element.detail">Element</a></li>
</ul>
</div>
<div class="navListSearch"><label for="search">SEARCH:</label>
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">
</div>
</div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="skipNav"><a id="skip.navbar.top">
<!-- -->
</a></div>
</nav>
</header>
<div class="flexContent">
<main role="main">
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle"><span class="packageLabelInType">Package</span>&nbsp;<a href="package-summary.html">org.apache.calcite.linq4j.function</a></div>
<h1 title="Annotation Type Parameter" class="title">Annotation Type Parameter</h1>
</div>
<div class="contentContainer">
<section class="description">
<hr>
<pre><a href="https://docs.oracle.com/javase/9/docs/api/java/lang/annotation/Retention.html?is-external=true" title="class or interface in java.lang.annotation" class="externalLink">@Retention</a>(<a href="https://docs.oracle.com/javase/9/docs/api/java/lang/annotation/RetentionPolicy.html?is-external=true#RUNTIME" title="class or interface in java.lang.annotation" class="externalLink">RUNTIME</a>)
<a href="https://docs.oracle.com/javase/9/docs/api/java/lang/annotation/Target.html?is-external=true" title="class or interface in java.lang.annotation" class="externalLink">@Target</a>(<a href="https://docs.oracle.com/javase/9/docs/api/java/lang/annotation/ElementType.html?is-external=true#PARAMETER" title="class or interface in java.lang.annotation" class="externalLink">PARAMETER</a>)
public @interface <span class="memberNameLabel">Parameter</span></pre>
<div class="block">Annotation that supplies metadata about a function parameter.
<p>A typical use is to derive names for the parameters of user-defined
functions.
<p>Here is an example:
<blockquote><pre>
public static class MyLeftFunction {
public String eval(
&#64;Parameter(name = "s") String s,
&#64;Parameter(name = "n", optional = true) Integer n) {
return s.substring(0, n == null ? 1 : n);
}
}</pre></blockquote>
<p>The first parameter is named "s" and is mandatory,
and the second parameter is named "n" and is optional.
<p>If this annotation is present, it supersedes information that might be
available via
<code>Executable.getParameters()</code> (JDK 1.8 and above).
<p>If the annotation is not specified, parameters will be named "arg0",
"arg1" et cetera, and will be mandatory.</div>
</section>
<section class="summary">
<ul class="blockList">
<!-- =========== ANNOTATION TYPE REQUIRED MEMBER SUMMARY =========== -->
<li class="blockList">
<section class="memberSummary"><a id="annotation.type.required.element.summary">
<!-- -->
</a>
<h2>Required Element Summary</h2>
<div class="memberSummary">
<table>
<caption><span>Required Elements</span><span class="tabEnd">&nbsp;</span></caption>
<thead>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Required Element</th>
<th class="colLast" scope="col">Description</th>
</tr>
</thead>
<tbody>
<tr class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/9/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#name()">name</a></span></code></th>
<td class="colLast">
<div class="block">The name of the parameter.</div>
</td>
</tr>
</tbody>
</table>
</div>
</section>
</li>
<!-- =========== ANNOTATION TYPE OPTIONAL MEMBER SUMMARY =========== -->
<li class="blockList">
<section class="memberSummary"><a id="annotation.type.optional.element.summary">
<!-- -->
</a>
<h2>Optional Element Summary</h2>
<div class="memberSummary">
<table>
<caption><span>Optional Elements</span><span class="tabEnd">&nbsp;</span></caption>
<thead>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Optional Element</th>
<th class="colLast" scope="col">Description</th>
</tr>
</thead>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#optional()">optional</a></span></code></th>
<td class="colLast">
<div class="block">Returns whether the parameter is optional.</div>
</td>
</tr>
</tbody>
</table>
</div>
</section>
</li>
</ul>
</section>
<section class="details">
<ul class="blockList">
<!-- ============ ANNOTATION TYPE MEMBER DETAIL =========== -->
<li class="blockList">
<section class="memberDetails"><a id="annotation.type.element.detail">
<!-- -->
</a>
<h2>Element Details</h2>
<ul class="blockList">
<li class="blockList">
<section class="detail">
<h3><a id="name()">name</a></h3>
<div class="memberSignature"><span class="returnType"><a href="https://docs.oracle.com/javase/9/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a></span>&nbsp;<span class="memberName">name</span></div>
<div class="block">The name of the parameter.
<p>The name is used when the function is called
with parameter assignment, for example <code>foo(x =&gt; 1, y =&gt; 'a')</code>.</div>
</section>
</li>
</ul>
</section>
</li>
<!-- ============ ANNOTATION TYPE MEMBER DETAIL =========== -->
<li class="blockList">
<section class="memberDetails">
<ul class="blockList">
<li class="blockList">
<section class="detail">
<h3><a id="optional()">optional</a></h3>
<div class="memberSignature"><span class="returnType">boolean</span>&nbsp;<span class="memberName">optional</span></div>
<div class="block">Returns whether the parameter is optional.
<p>An optional parameter does not need to be specified when you call the
function.
<p>If you call a function using positional parameter syntax, you can omit
optional parameters on the trailing edge. For example, if you have a
function
<code>baz(int a, int b optional, int c, int d optional, int e optional)</code>
then you can call <code>baz(a, b, c, d, e)</code>
or <code>baz(a, b, c, d)</code>
or <code>baz(a, b, c)</code>
but not <code>baz(a, b)</code> because <code>c</code> is not optional.
<p>If you call a function using parameter name assignment syntax, you can
omit any parameter that has a default value. For example, you can call
<code>baz(a =&gt; 1, e =&gt; 5, c =&gt; 3)</code>, omitting optional parameters <code>b</code>
and <code>d</code>.
<p>Currently, the default value used when a parameter is not specified
is NULL, and therefore optional parameters must be nullable.</div>
<dl>
<dt>Default:</dt>
<dd>false</dd>
</dl>
</section>
</li>
</ul>
</section>
</li>
</ul>
</section>
</div>
<!-- ========= END OF CLASS DATA ========= -->
</main>
<footer role="contentinfo">
<nav role="navigation">
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a id="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">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">Help</a></li>
</ul>
<div class="aboutLanguage"><b>Apache Calcite</b></div>
</div>
<div class="subNav">
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#annotation.type.required.element.summary">Required</a>&nbsp;|&nbsp;</li>
<li><a href="#annotation.type.optional.element.summary">Optional</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#annotation.type.element.detail">Element</a></li>
</ul>
</div>
</div>
<a id="skip.navbar.bottom">
<!-- -->
</a>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</nav>
<p class="legalCopy"><small>Copyright &copy; 2012-2021 Apache Software Foundation. All Rights Reserved.</small></p>
</footer>
</div>
</div>
</body>
</html>