You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<divclass="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><ahref="Parser.html" title="class in com.google.common.labs.parse">Parser</a><<ahref="https://docs.oracle.com/en/java/javase/24/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a><<ahref="Parser.html#type-param-T" title="type parameter in Parser">T</a>>>.<ahref="Parser.OrEmpty.html" title="class in com.google.common.labs.parse">OrEmpty</a></code></div>
158
158
<divclass="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><ahref="#delimitedBy(java.lang.String)" class="member-name-link">delimitedBy</a><wbr>(<ahref="https://docs.oracle.com/en/java/javase/24/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> delimiter)</code></div>
<divclass="block">The current optional parser repeated at least once, delimited by <code>delimiter</code>.</div>
160
+
<divclass="block">The current optional parser repeated and delimited by <code>delimiter</code>.</div>
161
161
</div>
162
162
<divclass="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><R> <ahref="Parser.html" title="class in com.google.common.labs.parse">Parser</a><R>.<ahref="Parser.OrEmpty.html" title="class in com.google.common.labs.parse">OrEmpty</a></code></div>
163
163
<divclass="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><ahref="#delimitedBy(java.lang.String,java.util.stream.Collector)" class="member-name-link">delimitedBy</a><wbr>(<ahref="https://docs.oracle.com/en/java/javase/24/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> delimiter,
164
164
<ahref="https://docs.oracle.com/en/java/javase/24/docs/api/java.base/java/util/stream/Collector.html" title="class or interface in java.util.stream" class="external-link">Collector</a><? super <ahref="Parser.html#type-param-T" title="type parameter in Parser">T</a>, ?, R> collector)</code></div>
<divclass="block">The current optional parser repeated at least once, delimited by <code>delimiter</code>.</div>
166
+
<divclass="block">The current optional parser repeated and delimited by <code>delimiter</code>.</div>
167
167
</div>
168
168
<divclass="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><S> <ahref="Parser.html" title="class in com.google.common.labs.parse">Parser</a><<ahref="Parser.html#type-param-T" title="type parameter in Parser">T</a>>.<ahref="Parser.OrEmpty.html" title="class in com.google.common.labs.parse">OrEmpty</a></code></div>
169
169
<divclass="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><ahref="#followedBy(com.google.common.labs.parse.Parser.OrEmpty)" class="member-name-link">followedBy</a><wbr>(<ahref="Parser.html" title="class in com.google.common.labs.parse">Parser</a><S>.<ahref="Parser.OrEmpty.html" title="class in com.google.common.labs.parse">OrEmpty</a> suffix)</code></div>
@@ -267,9 +267,10 @@ <h3>delimitedBy</h3>
267
267
<divclass="horizontal-scroll">
268
268
<divclass="member-signature"><spanclass="modifiers">public</span> <spanclass="type-parameters"><R></span> <spanclass="return-type"><ahref="Parser.html" title="class in com.google.common.labs.parse">Parser</a><R>.<ahref="Parser.OrEmpty.html" title="class in com.google.common.labs.parse">OrEmpty</a></span> <spanclass="element-name">delimitedBy</span><wbr><spanclass="parameters">(<ahref="https://docs.oracle.com/en/java/javase/24/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> delimiter,
269
269
<ahref="https://docs.oracle.com/en/java/javase/24/docs/api/java.base/java/util/stream/Collector.html" title="class or interface in java.util.stream" class="external-link">Collector</a><? super <ahref="Parser.html#type-param-T" title="type parameter in Parser">T</a>, ?, R> collector)</span></div>
270
-
<divclass="block">The current optional parser repeated at least once, delimited by <code>delimiter</code>. If
271
-
parsing an element fails, the default value (e.g. from <code>orElse()</code>) is collected
272
-
instead.
270
+
<divclass="block">The current optional parser repeated and delimited by <code>delimiter</code>. Since this is an
271
+
optional parser, at least one value is guaranteed to be collected by the provided <code>
272
+
collector</code>, even if match failed. That is, on match failure, the default value (e.g. from
273
+
<code>orElse()</code>) will be used.
273
274
274
275
<p>Note that it's different from <ahref="Parser.html#zeroOrMoreDelimitedBy(java.lang.String)"><code>Parser.zeroOrMoreDelimitedBy(java.lang.String)</code></a>, which may produce
275
276
empty list, but each element is guaranteed to be non-empty.</div>
@@ -281,8 +282,8 @@ <h3>delimitedBy</h3>
281
282
<h3>delimitedBy</h3>
282
283
<divclass="horizontal-scroll">
283
284
<divclass="member-signature"><spanclass="modifiers">public</span> <spanclass="return-type"><ahref="Parser.html" title="class in com.google.common.labs.parse">Parser</a><<ahref="https://docs.oracle.com/en/java/javase/24/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a><<ahref="Parser.html#type-param-T" title="type parameter in Parser">T</a>>>.<ahref="Parser.OrEmpty.html" title="class in com.google.common.labs.parse">OrEmpty</a></span> <spanclass="element-name">delimitedBy</span><wbr><spanclass="parameters">(<ahref="https://docs.oracle.com/en/java/javase/24/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> delimiter)</span></div>
284
-
<divclass="block">The current optional parser repeated at least once, delimited by <code>delimiter</code>. If empty,
285
-
the result is a singleton list with the default value (e.g. from <code>orElse()</code>). For
285
+
<divclass="block">The current optional parser repeated and delimited by <code>delimiter</code>. Since this is an
286
+
optional parser, at least one element is guaranteed to be returned, even if match failed. For
286
287
example, <code>consecutive(WORD).orElse("").delimitedBy(",")</code> will <ahref="#parse(java.lang.String)"><code>parse</code></a>
287
288
input <code>",a,"</code> as <code>List.of("", "a", "")</code>; and parse empty input <code>""</code> as
0 commit comments