Network programming assignment for University
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Option.Builder.html 26 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <!-- NewPage -->
  3. <html lang="de">
  4. <head>
  5. <!-- Generated by javadoc -->
  6. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  7. <title>Option.Builder (Apache Commons CLI 1.4 API)</title>
  8. <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
  9. <script type="text/javascript" src="../../../../script.js"></script>
  10. </head>
  11. <body>
  12. <script type="text/javascript"><!--
  13. try {
  14. if (location.href.indexOf('is-external=true') == -1) {
  15. parent.document.title="Option.Builder (Apache Commons CLI 1.4 API)";
  16. }
  17. }
  18. catch(err) {
  19. }
  20. //-->
  21. var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10};
  22. var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
  23. var altColor = "altColor";
  24. var rowColor = "rowColor";
  25. var tableTab = "tableTab";
  26. var activeTableTab = "activeTableTab";
  27. </script>
  28. <noscript>
  29. <div>JavaScript is disabled on your browser.</div>
  30. </noscript>
  31. <!-- ========= START OF TOP NAVBAR ======= -->
  32. <div class="topNav"><a name="navbar.top">
  33. <!-- -->
  34. </a>
  35. <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
  36. <a name="navbar.top.firstrow">
  37. <!-- -->
  38. </a>
  39. <ul class="navList" title="Navigation">
  40. <li><a href="../../../../org/apache/commons/cli/package-summary.html">Package</a></li>
  41. <li class="navBarCell1Rev">Class</li>
  42. <li><a href="class-use/Option.Builder.html">Use</a></li>
  43. <li><a href="package-tree.html">Tree</a></li>
  44. <li><a href="../../../../deprecated-list.html">Deprecated</a></li>
  45. <li><a href="../../../../index-all.html">Index</a></li>
  46. <li><a href="../../../../help-doc.html">Help</a></li>
  47. </ul>
  48. </div>
  49. <div class="subNav">
  50. <ul class="navList">
  51. <li><a href="../../../../org/apache/commons/cli/Option.html" title="class in org.apache.commons.cli"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
  52. <li><a href="../../../../org/apache/commons/cli/OptionBuilder.html" title="class in org.apache.commons.cli"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
  53. </ul>
  54. <ul class="navList">
  55. <li><a href="../../../../index.html?org/apache/commons/cli/Option.Builder.html" target="_top">Frames</a></li>
  56. <li><a href="Option.Builder.html" target="_top">No&nbsp;Frames</a></li>
  57. </ul>
  58. <ul class="navList" id="allclasses_navbar_top">
  59. <li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
  60. </ul>
  61. <div>
  62. <script type="text/javascript"><!--
  63. allClassesLink = document.getElementById("allclasses_navbar_top");
  64. if(window==top) {
  65. allClassesLink.style.display = "block";
  66. }
  67. else {
  68. allClassesLink.style.display = "none";
  69. }
  70. //-->
  71. </script>
  72. </div>
  73. <div>
  74. <ul class="subNavList">
  75. <li>Summary:&nbsp;</li>
  76. <li>Nested&nbsp;|&nbsp;</li>
  77. <li>Field&nbsp;|&nbsp;</li>
  78. <li>Constr&nbsp;|&nbsp;</li>
  79. <li><a href="#method.summary">Method</a></li>
  80. </ul>
  81. <ul class="subNavList">
  82. <li>Detail:&nbsp;</li>
  83. <li>Field&nbsp;|&nbsp;</li>
  84. <li>Constr&nbsp;|&nbsp;</li>
  85. <li><a href="#method.detail">Method</a></li>
  86. </ul>
  87. </div>
  88. <a name="skip.navbar.top">
  89. <!-- -->
  90. </a></div>
  91. <!-- ========= END OF TOP NAVBAR ========= -->
  92. <!-- ======== START OF CLASS DATA ======== -->
  93. <div class="header">
  94. <div class="subTitle">org.apache.commons.cli</div>
  95. <h2 title="Class Option.Builder" class="title">Class Option.Builder</h2>
  96. </div>
  97. <div class="contentContainer">
  98. <ul class="inheritance">
  99. <li><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
  100. <li>
  101. <ul class="inheritance">
  102. <li>org.apache.commons.cli.Option.Builder</li>
  103. </ul>
  104. </li>
  105. </ul>
  106. <div class="description">
  107. <ul class="blockList">
  108. <li class="blockList">
  109. <dl>
  110. <dt>Enclosing class:</dt>
  111. <dd><a href="../../../../org/apache/commons/cli/Option.html" title="class in org.apache.commons.cli">Option</a></dd>
  112. </dl>
  113. <hr>
  114. <br>
  115. <pre>public static final class <span class="typeNameLabel">Option.Builder</span>
  116. extends <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre>
  117. <div class="block">A nested builder class to create <code>Option</code> instances
  118. using descriptive methods.
  119. <p>
  120. Example usage:
  121. <pre>
  122. Option option = Option.builder("a")
  123. .required(true)
  124. .longOpt("arg-name")
  125. .build();
  126. </pre></div>
  127. <dl>
  128. <dt><span class="simpleTagLabel">Since:</span></dt>
  129. <dd>1.3</dd>
  130. </dl>
  131. </li>
  132. </ul>
  133. </div>
  134. <div class="summary">
  135. <ul class="blockList">
  136. <li class="blockList">
  137. <!-- ========== METHOD SUMMARY =========== -->
  138. <ul class="blockList">
  139. <li class="blockList"><a name="method.summary">
  140. <!-- -->
  141. </a>
  142. <h3>Method Summary</h3>
  143. <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
  144. <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
  145. <tr>
  146. <th class="colFirst" scope="col">Modifier and Type</th>
  147. <th class="colLast" scope="col">Method and Description</th>
  148. </tr>
  149. <tr id="i0" class="altColor">
  150. <td class="colFirst"><code><a href="../../../../org/apache/commons/cli/Option.Builder.html" title="class in org.apache.commons.cli">Option.Builder</a></code></td>
  151. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/cli/Option.Builder.html#argName-java.lang.String-">argName</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;argName)</code>
  152. <div class="block">Sets the display name for the argument value.</div>
  153. </td>
  154. </tr>
  155. <tr id="i1" class="rowColor">
  156. <td class="colFirst"><code><a href="../../../../org/apache/commons/cli/Option.html" title="class in org.apache.commons.cli">Option</a></code></td>
  157. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/cli/Option.Builder.html#build--">build</a></span>()</code>
  158. <div class="block">Constructs an Option with the values declared by this <a href="../../../../org/apache/commons/cli/Option.Builder.html" title="class in org.apache.commons.cli"><code>Option.Builder</code></a>.</div>
  159. </td>
  160. </tr>
  161. <tr id="i2" class="altColor">
  162. <td class="colFirst"><code><a href="../../../../org/apache/commons/cli/Option.Builder.html" title="class in org.apache.commons.cli">Option.Builder</a></code></td>
  163. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/cli/Option.Builder.html#desc-java.lang.String-">desc</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;description)</code>
  164. <div class="block">Sets the description for this option.</div>
  165. </td>
  166. </tr>
  167. <tr id="i3" class="rowColor">
  168. <td class="colFirst"><code><a href="../../../../org/apache/commons/cli/Option.Builder.html" title="class in org.apache.commons.cli">Option.Builder</a></code></td>
  169. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/cli/Option.Builder.html#hasArg--">hasArg</a></span>()</code>
  170. <div class="block">Indicates that the Option will require an argument.</div>
  171. </td>
  172. </tr>
  173. <tr id="i4" class="altColor">
  174. <td class="colFirst"><code><a href="../../../../org/apache/commons/cli/Option.Builder.html" title="class in org.apache.commons.cli">Option.Builder</a></code></td>
  175. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/cli/Option.Builder.html#hasArg-boolean-">hasArg</a></span>(boolean&nbsp;hasArg)</code>
  176. <div class="block">Indicates if the Option has an argument or not.</div>
  177. </td>
  178. </tr>
  179. <tr id="i5" class="rowColor">
  180. <td class="colFirst"><code><a href="../../../../org/apache/commons/cli/Option.Builder.html" title="class in org.apache.commons.cli">Option.Builder</a></code></td>
  181. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/cli/Option.Builder.html#hasArgs--">hasArgs</a></span>()</code>
  182. <div class="block">Indicates that the Option can have unlimited argument values.</div>
  183. </td>
  184. </tr>
  185. <tr id="i6" class="altColor">
  186. <td class="colFirst"><code><a href="../../../../org/apache/commons/cli/Option.Builder.html" title="class in org.apache.commons.cli">Option.Builder</a></code></td>
  187. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/cli/Option.Builder.html#longOpt-java.lang.String-">longOpt</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;longOpt)</code>
  188. <div class="block">Sets the long name of the Option.</div>
  189. </td>
  190. </tr>
  191. <tr id="i7" class="rowColor">
  192. <td class="colFirst"><code><a href="../../../../org/apache/commons/cli/Option.Builder.html" title="class in org.apache.commons.cli">Option.Builder</a></code></td>
  193. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/cli/Option.Builder.html#numberOfArgs-int-">numberOfArgs</a></span>(int&nbsp;numberOfArgs)</code>
  194. <div class="block">Sets the number of argument values the Option can take.</div>
  195. </td>
  196. </tr>
  197. <tr id="i8" class="altColor">
  198. <td class="colFirst"><code><a href="../../../../org/apache/commons/cli/Option.Builder.html" title="class in org.apache.commons.cli">Option.Builder</a></code></td>
  199. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/cli/Option.Builder.html#optionalArg-boolean-">optionalArg</a></span>(boolean&nbsp;isOptional)</code>
  200. <div class="block">Sets whether the Option can have an optional argument.</div>
  201. </td>
  202. </tr>
  203. <tr id="i9" class="rowColor">
  204. <td class="colFirst"><code><a href="../../../../org/apache/commons/cli/Option.Builder.html" title="class in org.apache.commons.cli">Option.Builder</a></code></td>
  205. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/cli/Option.Builder.html#required--">required</a></span>()</code>
  206. <div class="block">Marks this Option as required.</div>
  207. </td>
  208. </tr>
  209. <tr id="i10" class="altColor">
  210. <td class="colFirst"><code><a href="../../../../org/apache/commons/cli/Option.Builder.html" title="class in org.apache.commons.cli">Option.Builder</a></code></td>
  211. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/cli/Option.Builder.html#required-boolean-">required</a></span>(boolean&nbsp;required)</code>
  212. <div class="block">Sets whether the Option is mandatory.</div>
  213. </td>
  214. </tr>
  215. <tr id="i11" class="rowColor">
  216. <td class="colFirst"><code><a href="../../../../org/apache/commons/cli/Option.Builder.html" title="class in org.apache.commons.cli">Option.Builder</a></code></td>
  217. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/cli/Option.Builder.html#type-java.lang.Class-">type</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>&lt;?&gt;&nbsp;type)</code>
  218. <div class="block">Sets the type of the Option.</div>
  219. </td>
  220. </tr>
  221. <tr id="i12" class="altColor">
  222. <td class="colFirst"><code><a href="../../../../org/apache/commons/cli/Option.Builder.html" title="class in org.apache.commons.cli">Option.Builder</a></code></td>
  223. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/cli/Option.Builder.html#valueSeparator--">valueSeparator</a></span>()</code>
  224. <div class="block">The Option will use '=' as a means to separate argument value.</div>
  225. </td>
  226. </tr>
  227. <tr id="i13" class="rowColor">
  228. <td class="colFirst"><code><a href="../../../../org/apache/commons/cli/Option.Builder.html" title="class in org.apache.commons.cli">Option.Builder</a></code></td>
  229. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/cli/Option.Builder.html#valueSeparator-char-">valueSeparator</a></span>(char&nbsp;sep)</code>
  230. <div class="block">The Option will use <code>sep</code> as a means to
  231. separate argument values.</div>
  232. </td>
  233. </tr>
  234. </table>
  235. <ul class="blockList">
  236. <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
  237. <!-- -->
  238. </a>
  239. <h3>Methods inherited from class&nbsp;java.lang.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
  240. <code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li>
  241. </ul>
  242. </li>
  243. </ul>
  244. </li>
  245. </ul>
  246. </div>
  247. <div class="details">
  248. <ul class="blockList">
  249. <li class="blockList">
  250. <!-- ============ METHOD DETAIL ========== -->
  251. <ul class="blockList">
  252. <li class="blockList"><a name="method.detail">
  253. <!-- -->
  254. </a>
  255. <h3>Method Detail</h3>
  256. <a name="argName-java.lang.String-">
  257. <!-- -->
  258. </a>
  259. <ul class="blockList">
  260. <li class="blockList">
  261. <h4>argName</h4>
  262. <pre>public&nbsp;<a href="../../../../org/apache/commons/cli/Option.Builder.html" title="class in org.apache.commons.cli">Option.Builder</a>&nbsp;argName(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;argName)</pre>
  263. <div class="block">Sets the display name for the argument value.</div>
  264. <dl>
  265. <dt><span class="paramLabel">Parameters:</span></dt>
  266. <dd><code>argName</code> - the display name for the argument value.</dd>
  267. <dt><span class="returnLabel">Returns:</span></dt>
  268. <dd>this builder, to allow method chaining</dd>
  269. </dl>
  270. </li>
  271. </ul>
  272. <a name="desc-java.lang.String-">
  273. <!-- -->
  274. </a>
  275. <ul class="blockList">
  276. <li class="blockList">
  277. <h4>desc</h4>
  278. <pre>public&nbsp;<a href="../../../../org/apache/commons/cli/Option.Builder.html" title="class in org.apache.commons.cli">Option.Builder</a>&nbsp;desc(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;description)</pre>
  279. <div class="block">Sets the description for this option.</div>
  280. <dl>
  281. <dt><span class="paramLabel">Parameters:</span></dt>
  282. <dd><code>description</code> - the description of the option.</dd>
  283. <dt><span class="returnLabel">Returns:</span></dt>
  284. <dd>this builder, to allow method chaining</dd>
  285. </dl>
  286. </li>
  287. </ul>
  288. <a name="longOpt-java.lang.String-">
  289. <!-- -->
  290. </a>
  291. <ul class="blockList">
  292. <li class="blockList">
  293. <h4>longOpt</h4>
  294. <pre>public&nbsp;<a href="../../../../org/apache/commons/cli/Option.Builder.html" title="class in org.apache.commons.cli">Option.Builder</a>&nbsp;longOpt(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;longOpt)</pre>
  295. <div class="block">Sets the long name of the Option.</div>
  296. <dl>
  297. <dt><span class="paramLabel">Parameters:</span></dt>
  298. <dd><code>longOpt</code> - the long name of the Option</dd>
  299. <dt><span class="returnLabel">Returns:</span></dt>
  300. <dd>this builder, to allow method chaining</dd>
  301. </dl>
  302. </li>
  303. </ul>
  304. <a name="numberOfArgs-int-">
  305. <!-- -->
  306. </a>
  307. <ul class="blockList">
  308. <li class="blockList">
  309. <h4>numberOfArgs</h4>
  310. <pre>public&nbsp;<a href="../../../../org/apache/commons/cli/Option.Builder.html" title="class in org.apache.commons.cli">Option.Builder</a>&nbsp;numberOfArgs(int&nbsp;numberOfArgs)</pre>
  311. <div class="block">Sets the number of argument values the Option can take.</div>
  312. <dl>
  313. <dt><span class="paramLabel">Parameters:</span></dt>
  314. <dd><code>numberOfArgs</code> - the number of argument values</dd>
  315. <dt><span class="returnLabel">Returns:</span></dt>
  316. <dd>this builder, to allow method chaining</dd>
  317. </dl>
  318. </li>
  319. </ul>
  320. <a name="optionalArg-boolean-">
  321. <!-- -->
  322. </a>
  323. <ul class="blockList">
  324. <li class="blockList">
  325. <h4>optionalArg</h4>
  326. <pre>public&nbsp;<a href="../../../../org/apache/commons/cli/Option.Builder.html" title="class in org.apache.commons.cli">Option.Builder</a>&nbsp;optionalArg(boolean&nbsp;isOptional)</pre>
  327. <div class="block">Sets whether the Option can have an optional argument.</div>
  328. <dl>
  329. <dt><span class="paramLabel">Parameters:</span></dt>
  330. <dd><code>isOptional</code> - specifies whether the Option can have
  331. an optional argument.</dd>
  332. <dt><span class="returnLabel">Returns:</span></dt>
  333. <dd>this builder, to allow method chaining</dd>
  334. </dl>
  335. </li>
  336. </ul>
  337. <a name="required--">
  338. <!-- -->
  339. </a>
  340. <ul class="blockList">
  341. <li class="blockList">
  342. <h4>required</h4>
  343. <pre>public&nbsp;<a href="../../../../org/apache/commons/cli/Option.Builder.html" title="class in org.apache.commons.cli">Option.Builder</a>&nbsp;required()</pre>
  344. <div class="block">Marks this Option as required.</div>
  345. <dl>
  346. <dt><span class="returnLabel">Returns:</span></dt>
  347. <dd>this builder, to allow method chaining</dd>
  348. </dl>
  349. </li>
  350. </ul>
  351. <a name="required-boolean-">
  352. <!-- -->
  353. </a>
  354. <ul class="blockList">
  355. <li class="blockList">
  356. <h4>required</h4>
  357. <pre>public&nbsp;<a href="../../../../org/apache/commons/cli/Option.Builder.html" title="class in org.apache.commons.cli">Option.Builder</a>&nbsp;required(boolean&nbsp;required)</pre>
  358. <div class="block">Sets whether the Option is mandatory.</div>
  359. <dl>
  360. <dt><span class="paramLabel">Parameters:</span></dt>
  361. <dd><code>required</code> - specifies whether the Option is mandatory</dd>
  362. <dt><span class="returnLabel">Returns:</span></dt>
  363. <dd>this builder, to allow method chaining</dd>
  364. </dl>
  365. </li>
  366. </ul>
  367. <a name="type-java.lang.Class-">
  368. <!-- -->
  369. </a>
  370. <ul class="blockList">
  371. <li class="blockList">
  372. <h4>type</h4>
  373. <pre>public&nbsp;<a href="../../../../org/apache/commons/cli/Option.Builder.html" title="class in org.apache.commons.cli">Option.Builder</a>&nbsp;type(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>&lt;?&gt;&nbsp;type)</pre>
  374. <div class="block">Sets the type of the Option.</div>
  375. <dl>
  376. <dt><span class="paramLabel">Parameters:</span></dt>
  377. <dd><code>type</code> - the type of the Option</dd>
  378. <dt><span class="returnLabel">Returns:</span></dt>
  379. <dd>this builder, to allow method chaining</dd>
  380. </dl>
  381. </li>
  382. </ul>
  383. <a name="valueSeparator--">
  384. <!-- -->
  385. </a>
  386. <ul class="blockList">
  387. <li class="blockList">
  388. <h4>valueSeparator</h4>
  389. <pre>public&nbsp;<a href="../../../../org/apache/commons/cli/Option.Builder.html" title="class in org.apache.commons.cli">Option.Builder</a>&nbsp;valueSeparator()</pre>
  390. <div class="block">The Option will use '=' as a means to separate argument value.</div>
  391. <dl>
  392. <dt><span class="returnLabel">Returns:</span></dt>
  393. <dd>this builder, to allow method chaining</dd>
  394. </dl>
  395. </li>
  396. </ul>
  397. <a name="valueSeparator-char-">
  398. <!-- -->
  399. </a>
  400. <ul class="blockList">
  401. <li class="blockList">
  402. <h4>valueSeparator</h4>
  403. <pre>public&nbsp;<a href="../../../../org/apache/commons/cli/Option.Builder.html" title="class in org.apache.commons.cli">Option.Builder</a>&nbsp;valueSeparator(char&nbsp;sep)</pre>
  404. <div class="block">The Option will use <code>sep</code> as a means to
  405. separate argument values.
  406. <p>
  407. <b>Example:</b>
  408. <pre>
  409. Option opt = Option.builder("D").hasArgs()
  410. .valueSeparator('=')
  411. .build();
  412. Options options = new Options();
  413. options.addOption(opt);
  414. String[] args = {"-Dkey=value"};
  415. CommandLineParser parser = new DefaultParser();
  416. CommandLine line = parser.parse(options, args);
  417. String propertyName = line.getOptionValues("D")[0]; // will be "key"
  418. String propertyValue = line.getOptionValues("D")[1]; // will be "value"
  419. </pre></div>
  420. <dl>
  421. <dt><span class="paramLabel">Parameters:</span></dt>
  422. <dd><code>sep</code> - The value separator.</dd>
  423. <dt><span class="returnLabel">Returns:</span></dt>
  424. <dd>this builder, to allow method chaining</dd>
  425. </dl>
  426. </li>
  427. </ul>
  428. <a name="hasArg--">
  429. <!-- -->
  430. </a>
  431. <ul class="blockList">
  432. <li class="blockList">
  433. <h4>hasArg</h4>
  434. <pre>public&nbsp;<a href="../../../../org/apache/commons/cli/Option.Builder.html" title="class in org.apache.commons.cli">Option.Builder</a>&nbsp;hasArg()</pre>
  435. <div class="block">Indicates that the Option will require an argument.</div>
  436. <dl>
  437. <dt><span class="returnLabel">Returns:</span></dt>
  438. <dd>this builder, to allow method chaining</dd>
  439. </dl>
  440. </li>
  441. </ul>
  442. <a name="hasArg-boolean-">
  443. <!-- -->
  444. </a>
  445. <ul class="blockList">
  446. <li class="blockList">
  447. <h4>hasArg</h4>
  448. <pre>public&nbsp;<a href="../../../../org/apache/commons/cli/Option.Builder.html" title="class in org.apache.commons.cli">Option.Builder</a>&nbsp;hasArg(boolean&nbsp;hasArg)</pre>
  449. <div class="block">Indicates if the Option has an argument or not.</div>
  450. <dl>
  451. <dt><span class="paramLabel">Parameters:</span></dt>
  452. <dd><code>hasArg</code> - specifies whether the Option takes an argument or not</dd>
  453. <dt><span class="returnLabel">Returns:</span></dt>
  454. <dd>this builder, to allow method chaining</dd>
  455. </dl>
  456. </li>
  457. </ul>
  458. <a name="hasArgs--">
  459. <!-- -->
  460. </a>
  461. <ul class="blockList">
  462. <li class="blockList">
  463. <h4>hasArgs</h4>
  464. <pre>public&nbsp;<a href="../../../../org/apache/commons/cli/Option.Builder.html" title="class in org.apache.commons.cli">Option.Builder</a>&nbsp;hasArgs()</pre>
  465. <div class="block">Indicates that the Option can have unlimited argument values.</div>
  466. <dl>
  467. <dt><span class="returnLabel">Returns:</span></dt>
  468. <dd>this builder, to allow method chaining</dd>
  469. </dl>
  470. </li>
  471. </ul>
  472. <a name="build--">
  473. <!-- -->
  474. </a>
  475. <ul class="blockListLast">
  476. <li class="blockList">
  477. <h4>build</h4>
  478. <pre>public&nbsp;<a href="../../../../org/apache/commons/cli/Option.html" title="class in org.apache.commons.cli">Option</a>&nbsp;build()</pre>
  479. <div class="block">Constructs an Option with the values declared by this <a href="../../../../org/apache/commons/cli/Option.Builder.html" title="class in org.apache.commons.cli"><code>Option.Builder</code></a>.</div>
  480. <dl>
  481. <dt><span class="returnLabel">Returns:</span></dt>
  482. <dd>the new <a href="../../../../org/apache/commons/cli/Option.html" title="class in org.apache.commons.cli"><code>Option</code></a></dd>
  483. <dt><span class="throwsLabel">Throws:</span></dt>
  484. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if neither <code>opt</code> or <code>longOpt</code> has been set</dd>
  485. </dl>
  486. </li>
  487. </ul>
  488. </li>
  489. </ul>
  490. </li>
  491. </ul>
  492. </div>
  493. </div>
  494. <!-- ========= END OF CLASS DATA ========= -->
  495. <!-- ======= START OF BOTTOM NAVBAR ====== -->
  496. <div class="bottomNav"><a name="navbar.bottom">
  497. <!-- -->
  498. </a>
  499. <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
  500. <a name="navbar.bottom.firstrow">
  501. <!-- -->
  502. </a>
  503. <ul class="navList" title="Navigation">
  504. <li><a href="../../../../org/apache/commons/cli/package-summary.html">Package</a></li>
  505. <li class="navBarCell1Rev">Class</li>
  506. <li><a href="class-use/Option.Builder.html">Use</a></li>
  507. <li><a href="package-tree.html">Tree</a></li>
  508. <li><a href="../../../../deprecated-list.html">Deprecated</a></li>
  509. <li><a href="../../../../index-all.html">Index</a></li>
  510. <li><a href="../../../../help-doc.html">Help</a></li>
  511. </ul>
  512. </div>
  513. <div class="subNav">
  514. <ul class="navList">
  515. <li><a href="../../../../org/apache/commons/cli/Option.html" title="class in org.apache.commons.cli"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
  516. <li><a href="../../../../org/apache/commons/cli/OptionBuilder.html" title="class in org.apache.commons.cli"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
  517. </ul>
  518. <ul class="navList">
  519. <li><a href="../../../../index.html?org/apache/commons/cli/Option.Builder.html" target="_top">Frames</a></li>
  520. <li><a href="Option.Builder.html" target="_top">No&nbsp;Frames</a></li>
  521. </ul>
  522. <ul class="navList" id="allclasses_navbar_bottom">
  523. <li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
  524. </ul>
  525. <div>
  526. <script type="text/javascript"><!--
  527. allClassesLink = document.getElementById("allclasses_navbar_bottom");
  528. if(window==top) {
  529. allClassesLink.style.display = "block";
  530. }
  531. else {
  532. allClassesLink.style.display = "none";
  533. }
  534. //-->
  535. </script>
  536. </div>
  537. <div>
  538. <ul class="subNavList">
  539. <li>Summary:&nbsp;</li>
  540. <li>Nested&nbsp;|&nbsp;</li>
  541. <li>Field&nbsp;|&nbsp;</li>
  542. <li>Constr&nbsp;|&nbsp;</li>
  543. <li><a href="#method.summary">Method</a></li>
  544. </ul>
  545. <ul class="subNavList">
  546. <li>Detail:&nbsp;</li>
  547. <li>Field&nbsp;|&nbsp;</li>
  548. <li>Constr&nbsp;|&nbsp;</li>
  549. <li><a href="#method.detail">Method</a></li>
  550. </ul>
  551. </div>
  552. <a name="skip.navbar.bottom">
  553. <!-- -->
  554. </a></div>
  555. <!-- ======== END OF BOTTOM NAVBAR ======= -->
  556. <p class="legalCopy"><small>Copyright &#169; 2002&#x2013;2017 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
  557. </body>
  558. </html>