5 <title>JSDoc: Class: Enum</title>
7 <script src="scripts/prettify/prettify.js"> </script>
8 <script src="scripts/prettify/lang-css.js"> </script>
10 <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
12 <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
13 <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
20 <h1 class="page-title">Class: Enum</h1>
32 <span class="ancestors"><a href="ProtoBuf.html">ProtoBuf</a><a href="ProtoBuf.Reflect.html">.Reflect</a>.</span>
41 <div class="container-overview">
47 <h4 class="name" id="Enum"><span class="type-signature"></span>new Enum<span class="signature">(builder<span class="signature-attributes">non-null</span>, parent<span class="signature-attributes">non-null</span>, name, options<span class="signature-attributes">opt</span>, syntax<span class="signature-attributes">nullable</span>)</span><span class="type-signature"></span></h4>
53 <div class="description">
54 <p>Constructs a new Enum.</p>
68 <table class="params">
83 <th class="last">Description</th>
92 <td class="name"><code>builder</code></td>
98 <span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
105 <td class="attributes">
116 <td class="description last"><p>Builder reference</p></td>
123 <td class="name"><code>parent</code></td>
129 <span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
136 <td class="attributes">
147 <td class="description last"><p>Parent Reflect object</p></td>
154 <td class="name"><code>name</code></td>
160 <span class="param-type">string</span>
167 <td class="attributes">
178 <td class="description last"><p>Enum name</p></td>
185 <td class="name"><code>options</code></td>
191 <span class="param-type">Object.<string, *></span>
198 <td class="attributes">
211 <td class="description last"><p>Enum options</p></td>
218 <td class="name"><code>syntax</code></td>
224 <span class="param-type">string</span>
231 <td class="attributes">
244 <td class="description last"><p>The syntax level (e.g., proto3)</p></td>
283 <dt class="tag-source">Source:</dt>
284 <dd class="tag-source"><ul class="dummy"><li>
285 <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3831">line 3831</a>
315 <h3 class="subsection-title">Extends</h3>
321 <li><a href="ProtoBuf.Reflect.Namespace.html">ProtoBuf.Reflect.Namespace</a></li>
330 <h3 class="subsection-title">Classes</h3>
333 <dt><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></dt>
343 <h3 class="subsection-title">Members</h3>
347 <h4 class="name" id="builder"><span class="type-signature">(non-null) </span>builder<span class="type-signature"> :<a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span></h4>
352 <div class="description">
353 <p>Builder reference.</p>
362 <span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
379 <dt class="inherited-from">Inherited From:</dt>
380 <dd class="inherited-from"><ul class="dummy"><li>
381 <a href="ProtoBuf.Reflect.T.html#builder">ProtoBuf.Reflect.T#builder</a>
404 <dt class="tag-source">Source:</dt>
405 <dd class="tag-source"><ul class="dummy"><li>
406 <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1417">line 1417</a>
424 <h4 class="name" id="children"><span class="type-signature">(non-null) </span>children<span class="type-signature"> :Array.<<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a>></span></h4>
429 <div class="description">
430 <p>Children inside the namespace.</p>
439 <span class="param-type">Array.<<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a>></span>
456 <dt class="inherited-from">Inherited From:</dt>
457 <dd class="inherited-from"><ul class="dummy"><li>
458 <a href="ProtoBuf.Reflect.Namespace.html#children">ProtoBuf.Reflect.Namespace#children</a>
481 <dt class="tag-source">Source:</dt>
482 <dd class="tag-source"><ul class="dummy"><li>
483 <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1512">line 1512</a>
501 <h4 class="name" id="className"><span class="type-signature"></span>className<span class="type-signature"> :string</span></h4>
506 <div class="description">
507 <p>Fully qualified class name</p>
516 <span class="param-type">string</span>
535 <dt class="tag-overrides">Overrides:</dt>
536 <dd class="tag-overrides"><ul class="dummy"><li>
537 <a href="ProtoBuf.Reflect.Namespace.html#className">ProtoBuf.Reflect.Namespace#className</a>
558 <dt class="tag-source">Source:</dt>
559 <dd class="tag-source"><ul class="dummy"><li>
560 <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1438">line 1438</a>
578 <h4 class="name" id="name"><span class="type-signature"></span>name<span class="type-signature"> :string</span></h4>
583 <div class="description">
584 <p>Object name in namespace.</p>
593 <span class="param-type">string</span>
610 <dt class="inherited-from">Inherited From:</dt>
611 <dd class="inherited-from"><ul class="dummy"><li>
612 <a href="ProtoBuf.Reflect.T.html#name">ProtoBuf.Reflect.T#name</a>
635 <dt class="tag-source">Source:</dt>
636 <dd class="tag-source"><ul class="dummy"><li>
637 <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1431">line 1431</a>
655 <h4 class="name" id="object"><span class="type-signature"></span>object<span class="type-signature"> :Object.<string, number>|null</span></h4>
660 <div class="description">
661 <p>Runtime enum object.</p>
670 <span class="param-type">Object.<string, number></span>
673 <span class="param-type">null</span>
710 <dt class="tag-source">Source:</dt>
711 <dd class="tag-source"><ul class="dummy"><li>
712 <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3844">line 3844</a>
730 <h4 class="name" id="options"><span class="type-signature">(non-null) </span>options<span class="type-signature"> :Object.<string, *></span></h4>
735 <div class="description">
745 <span class="param-type">Object.<string, *></span>
762 <dt class="inherited-from">Inherited From:</dt>
763 <dd class="inherited-from"><ul class="dummy"><li>
764 <a href="ProtoBuf.Reflect.Namespace.html#options">ProtoBuf.Reflect.Namespace#options</a>
787 <dt class="tag-source">Source:</dt>
788 <dd class="tag-source"><ul class="dummy"><li>
789 <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1518">line 1518</a>
807 <h4 class="name" id="parent"><span class="type-signature">(nullable) </span>parent<span class="type-signature"> :<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span></h4>
812 <div class="description">
813 <p>Parent object.</p>
822 <span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
839 <dt class="inherited-from">Inherited From:</dt>
840 <dd class="inherited-from"><ul class="dummy"><li>
841 <a href="ProtoBuf.Reflect.T.html#parent">ProtoBuf.Reflect.T#parent</a>
864 <dt class="tag-source">Source:</dt>
865 <dd class="tag-source"><ul class="dummy"><li>
866 <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1424">line 1424</a>
884 <h4 class="name" id="syntax"><span class="type-signature">(non-null) </span>syntax<span class="type-signature"> :string</span></h4>
889 <div class="description">
890 <p>Syntax level (e.g., proto2 or proto3).</p>
899 <span class="param-type">string</span>
916 <dt class="inherited-from">Inherited From:</dt>
917 <dd class="inherited-from"><ul class="dummy"><li>
918 <a href="ProtoBuf.Reflect.Namespace.html#syntax">ProtoBuf.Reflect.Namespace#syntax</a>
941 <dt class="tag-source">Source:</dt>
942 <dd class="tag-source"><ul class="dummy"><li>
943 <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1524">line 1524</a>
963 <h3 class="subsection-title">Methods</h3>
970 <h4 class="name" id=".getName"><span class="type-signature">(static) </span>getName<span class="signature">(enm<span class="signature-attributes">non-null</span>, value)</span><span class="type-signature"> → (nullable) {string}</span></h4>
976 <div class="description">
977 <p>Gets the string name of an enum value.</p>
991 <table class="params">
1004 <th class="last">Description</th>
1013 <td class="name"><code>enm</code></td>
1019 <span class="param-type">ProtoBuf.Builder.Enum</span>
1029 <td class="description last"><p>Runtime enum</p></td>
1036 <td class="name"><code>value</code></td>
1042 <span class="param-type">number</span>
1052 <td class="description last"><p>Enum value</p></td>
1064 <dl class="details">
1091 <dt class="tag-source">Source:</dt>
1092 <dd class="tag-source"><ul class="dummy"><li>
1093 <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3854">line 3854</a>
1119 <div class="param-desc">
1120 <p>Name or <code>null</code> if not present</p>
1131 <span class="param-type">string</span>
1146 <h4 class="name" id="addChild"><span class="type-signature"></span>addChild<span class="signature">(child)</span><span class="type-signature"></span></h4>
1152 <div class="description">
1153 <p>Adds a child to the namespace.</p>
1164 <h5>Parameters:</h5>
1167 <table class="params">
1180 <th class="last">Description</th>
1189 <td class="name"><code>child</code></td>
1195 <span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
1205 <td class="description last"><p>Child</p></td>
1217 <dl class="details">
1224 <dt class="inherited-from">Inherited From:</dt>
1225 <dd class="inherited-from"><ul class="dummy"><li>
1226 <a href="ProtoBuf.Reflect.Namespace.html#addChild">ProtoBuf.Reflect.Namespace#addChild</a>
1249 <dt class="tag-source">Source:</dt>
1250 <dd class="tag-source"><ul class="dummy"><li>
1251 <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1556">line 1556</a>
1278 <div class="param-desc">
1279 <p>If the child cannot be added (duplicate)</p>
1290 <span class="param-type">Error</span>
1311 <h4 class="name" id="build"><span class="type-signature"></span>build<span class="signature">(rebuild)</span><span class="type-signature"> → (non-null) {Object.<string, number>}</span></h4>
1317 <div class="description">
1318 <p>Builds this enum and returns the runtime counterpart.</p>
1329 <h5>Parameters:</h5>
1332 <table class="params">
1345 <th class="last">Description</th>
1354 <td class="name"><code>rebuild</code></td>
1360 <span class="param-type">boolean</span>
1370 <td class="description last"><p>Whether to rebuild or not, defaults to false</p></td>
1382 <dl class="details">
1391 <dt class="tag-overrides">Overrides:</dt>
1392 <dd class="tag-overrides"><ul class="dummy"><li>
1393 <a href="ProtoBuf.Reflect.Namespace.html#build">ProtoBuf.Reflect.Namespace#build</a>
1414 <dt class="tag-source">Source:</dt>
1415 <dd class="tag-source"><ul class="dummy"><li>
1416 <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3874">line 3874</a>
1450 <span class="param-type">Object.<string, number></span>
1465 <h4 class="name" id="buildOpt"><span class="type-signature"></span>buildOpt<span class="signature">()</span><span class="type-signature"> → {Object.<string, *>}</span></h4>
1471 <div class="description">
1472 <p>Builds the namespace's '$options' property.</p>
1487 <dl class="details">
1494 <dt class="inherited-from">Inherited From:</dt>
1495 <dd class="inherited-from"><ul class="dummy"><li>
1496 <a href="ProtoBuf.Reflect.Namespace.html#buildOpt">ProtoBuf.Reflect.Namespace#buildOpt</a>
1519 <dt class="tag-source">Source:</dt>
1520 <dd class="tag-source"><ul class="dummy"><li>
1521 <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1666">line 1666</a>
1555 <span class="param-type">Object.<string, *></span>
1570 <h4 class="name" id="fqn"><span class="type-signature"></span>fqn<span class="signature">()</span><span class="type-signature"> → {string}</span></h4>
1576 <div class="description">
1577 <p>Returns the fully qualified name of this object.</p>
1592 <dl class="details">
1599 <dt class="inherited-from">Inherited From:</dt>
1600 <dd class="inherited-from"><ul class="dummy"><li>
1601 <a href="ProtoBuf.Reflect.T.html#fqn">ProtoBuf.Reflect.T#fqn</a>
1624 <dt class="tag-source">Source:</dt>
1625 <dd class="tag-source"><ul class="dummy"><li>
1626 <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1452">line 1452</a>
1652 <div class="param-desc">
1653 <p>Fully qualified name as of ".PATH.TO.THIS"</p>
1664 <span class="param-type">string</span>
1679 <h4 class="name" id="getChild"><span class="type-signature"></span>getChild<span class="signature">(nameOrId)</span><span class="type-signature"> → (nullable) {<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a>}</span></h4>
1685 <div class="description">
1686 <p>Gets a child by its name or id.</p>
1697 <h5>Parameters:</h5>
1700 <table class="params">
1713 <th class="last">Description</th>
1722 <td class="name"><code>nameOrId</code></td>
1728 <span class="param-type">string</span>
1731 <span class="param-type">number</span>
1741 <td class="description last"><p>Child name or id</p></td>
1753 <dl class="details">
1760 <dt class="inherited-from">Inherited From:</dt>
1761 <dd class="inherited-from"><ul class="dummy"><li>
1762 <a href="ProtoBuf.Reflect.Namespace.html#getChild">ProtoBuf.Reflect.Namespace#getChild</a>
1785 <dt class="tag-source">Source:</dt>
1786 <dd class="tag-source"><ul class="dummy"><li>
1787 <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1576">line 1576</a>
1813 <div class="param-desc">
1814 <p>The child or null if not found</p>
1825 <span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
1840 <h4 class="name" id="getChildren"><span class="type-signature"></span>getChildren<span class="signature">(type<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {Array.<<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a>>}</span></h4>
1846 <div class="description">
1847 <p>Returns an array of the namespace's children.</p>
1858 <h5>Parameters:</h5>
1861 <table class="params">
1876 <th class="last">Description</th>
1885 <td class="name"><code>type</code></td>
1891 <span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
1898 <td class="attributes">
1911 <td class="description last"><p>Filter type (returns instances of this type only). Defaults to null (all children).</p></td>
1923 <dl class="details">
1930 <dt class="inherited-from">Inherited From:</dt>
1931 <dd class="inherited-from"><ul class="dummy"><li>
1932 <a href="ProtoBuf.Reflect.Namespace.html#getChildren">ProtoBuf.Reflect.Namespace#getChildren</a>
1955 <dt class="tag-source">Source:</dt>
1956 <dd class="tag-source"><ul class="dummy"><li>
1957 <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1539">line 1539</a>
1991 <span class="param-type">Array.<<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a>></span>
2006 <h4 class="name" id="getOption"><span class="type-signature"></span>getOption<span class="signature">(name<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {*|Object.<string, *>}</span></h4>
2012 <div class="description">
2013 <p>Gets the value assigned to the option with the specified name.</p>
2024 <h5>Parameters:</h5>
2027 <table class="params">
2042 <th class="last">Description</th>
2051 <td class="name"><code>name</code></td>
2057 <span class="param-type">string</span>
2064 <td class="attributes">
2077 <td class="description last"><p>Returns the option value if specified, otherwise all options are returned.</p></td>
2089 <dl class="details">
2096 <dt class="inherited-from">Inherited From:</dt>
2097 <dd class="inherited-from"><ul class="dummy"><li>
2098 <a href="ProtoBuf.Reflect.Namespace.html#getOption">ProtoBuf.Reflect.Namespace#getOption</a>
2121 <dt class="tag-source">Source:</dt>
2122 <dd class="tag-source"><ul class="dummy"><li>
2123 <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1687">line 1687</a>
2149 <div class="param-desc">
2150 <p>null} Option value or NULL if there is no such option</p>
2161 <span class="param-type">*</span>
2164 <span class="param-type">Object.<string, *></span>
2179 <h4 class="name" id="qn"><span class="type-signature"></span>qn<span class="signature">(t<span class="signature-attributes">non-null</span>)</span><span class="type-signature"> → {string}</span></h4>
2185 <div class="description">
2186 <p>Determines the shortest qualified name of the specified type, if any, relative to this namespace.</p>
2197 <h5>Parameters:</h5>
2200 <table class="params">
2213 <th class="last">Description</th>
2222 <td class="name"><code>t</code></td>
2228 <span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
2238 <td class="description last"><p>Reflection type</p></td>
2250 <dl class="details">
2257 <dt class="inherited-from">Inherited From:</dt>
2258 <dd class="inherited-from"><ul class="dummy"><li>
2259 <a href="ProtoBuf.Reflect.Namespace.html#qn">ProtoBuf.Reflect.Namespace#qn</a>
2282 <dt class="tag-source">Source:</dt>
2283 <dd class="tag-source"><ul class="dummy"><li>
2284 <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1629">line 1629</a>
2310 <div class="param-desc">
2311 <p>The shortest qualified name or, if there is none, the fqn</p>
2322 <span class="param-type">string</span>
2337 <h4 class="name" id="resolve"><span class="type-signature"></span>resolve<span class="signature">(qn, excludeNonNamespace<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → (nullable) {<a href="ProtoBuf.Reflect.Namespace.html">ProtoBuf.Reflect.Namespace</a>}</span></h4>
2343 <div class="description">
2344 <p>Resolves a reflect object inside of this namespace.</p>
2355 <h5>Parameters:</h5>
2358 <table class="params">
2373 <th class="last">Description</th>
2382 <td class="name"><code>qn</code></td>
2388 <span class="param-type">string</span>
2391 <span class="param-type">!Array.<string></span>
2398 <td class="attributes">
2409 <td class="description last"><p>Qualified name to resolve</p></td>
2416 <td class="name"><code>excludeNonNamespace</code></td>
2422 <span class="param-type">boolean</span>
2429 <td class="attributes">
2442 <td class="description last"><p>Excludes non-namespace types, defaults to <code>false</code></p></td>
2454 <dl class="details">
2461 <dt class="inherited-from">Inherited From:</dt>
2462 <dd class="inherited-from"><ul class="dummy"><li>
2463 <a href="ProtoBuf.Reflect.Namespace.html#resolve">ProtoBuf.Reflect.Namespace#resolve</a>
2486 <dt class="tag-source">Source:</dt>
2487 <dd class="tag-source"><ul class="dummy"><li>
2488 <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1591">line 1591</a>
2514 <div class="param-desc">
2515 <p>The resolved type or null if not found</p>
2526 <span class="param-type"><a href="ProtoBuf.Reflect.Namespace.html">ProtoBuf.Reflect.Namespace</a></span>
2541 <h4 class="name" id="toString"><span class="type-signature"></span>toString<span class="signature">(includeClass<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
2547 <div class="description">
2548 <p>Returns a string representation of this Reflect object (its fully qualified name).</p>
2559 <h5>Parameters:</h5>
2562 <table class="params">
2577 <th class="last">Description</th>
2586 <td class="name"><code>includeClass</code></td>
2592 <span class="param-type">boolean</span>
2599 <td class="attributes">
2612 <td class="description last"><p>Set to true to include the class name. Defaults to false.</p></td>
2624 <dl class="details">
2631 <dt class="inherited-from">Inherited From:</dt>
2632 <dd class="inherited-from"><ul class="dummy"><li>
2633 <a href="ProtoBuf.Reflect.T.html#toString">ProtoBuf.Reflect.T#toString</a>
2656 <dt class="tag-source">Source:</dt>
2657 <dd class="tag-source"><ul class="dummy"><li>
2658 <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1470">line 1470</a>
2684 <div class="param-desc">
2685 <p>String representation</p>
2710 <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
2716 Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
2719 <script> prettyPrint(); </script>
2720 <script src="scripts/linenumber.js"> </script>