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
Copy file name to clipboardExpand all lines: pom.xml
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -51,6 +51,8 @@
51
51
<!-- as in http://stackoverflow.com/a/23543181/1399395 -->
52
52
<additionalparam>-Xdoclint:none</additionalparam>
53
53
<bottom><![CDATA[Copyright © {inceptionYear}–{currentYear}, <a href="http://www.codebulb.ch">codebulb.ch<a>. All rights reserved.]]></bottom>
54
+
<!-- copy additional javadoc folder resources -->
55
+
<docfilessubdirs>true</docfilessubdirs>
54
56
</configuration>
55
57
<!-- attach JavaDoc for JitPack distribution -->
56
58
<!-- as in https://github.com/jitpack/maven-simple/blob/master/pom.xml -->
<h2><aid="user-content-whats-in-the-box" class="anchor" href="#whats-in-the-box" aria-hidden="true"><spanclass="octicon octicon-link"></span></a>What’s in the box?</h2>
10
+
<h2><aaria-hidden="true" href="#whats-in-the-box" class="anchor" id="user-content-whats-in-the-box"><spanclass="octicon octicon-link"></span></a>What’s in the box?</h2>
11
11
12
12
<p>LambdaOmega consists of only a few classes. For brevity reasons, most of their names consist of a single letter.</p>
13
13
14
14
<ul>
15
-
<li><code>L</code> (“List”) is a wrapper for List.</li>
16
-
<li><code>M</code> (“Map”) is a wrapper for Map.</li>
17
-
<li><code>S</code> (“Set”) is a wrapper for Set.</li>
18
-
<li><code>R</code> (“Range”) is a wrapper for an IntStream range.</li>
19
-
<li><code>V2</code> (“Vector 2D”) represents a 2D vector (= a 2-ary tuple). It can be converted into a Map.Entry.</li>
20
-
<li><code>F</code> (“Function”) is a wrapper for functional interfaces (lambda expressions) which also provides helper methods to convert functions.</li>
21
-
<li><code>C</code> (“Collection”) is the base class for L and M and provides additional helper methods to convert collections.</li>
<li><code>Promise</code> is a wrapper and a drop-in replacement for CompletableFuture, providing several simplifications and fixes for the API. It can be used independently of all the other classes. It’s discussed in a separate section.</li>
15
+
<li><code>L</code> (“List”) is a wrapper for List.</li>
16
+
<li><code>M</code> (“Map”) is a wrapper for Map.</li>
17
+
<li><code>S</code> (“Set”) is a wrapper for Set.</li>
18
+
<li><code>R</code> (“Range”) is a wrapper for an IntStream range.</li>
19
+
<li><code>V2</code> (“Vector 2D”) represents a 2D vector (= a 2-ary tuple). It can be converted into a Map.Entry.</li>
20
+
<li><code>F</code> (“Function”) is a wrapper for functional interfaces (lambda expressions) which also provides helper methods to convert functions.</li>
21
+
<li><code>C</code> (“Collection”) is the base class for L and M and provides additional helper methods to convert collections.</li>
<li><code>Promise</code> is a wrapper and a drop-in replacement for CompletableFuture, providing several simplifications and fixes for the API. It can be used independently of all the other classes. It’s discussed in a separate section.</li>
24
24
</ul>
25
25
26
-
<h2><aid="user-content-why-you-should-use-it" class="anchor" href="#why-you-should-use-it" aria-hidden="true"><spanclass="octicon octicon-link"></span></a>Why you should use it</h2>
26
+
<h2><aaria-hidden="true" href="#why-you-should-use-it" class="anchor" id="user-content-why-you-should-use-it"><spanclass="octicon octicon-link"></span></a>Why you should use it</h2>
27
27
28
28
<ul>
29
-
<li>Although Java’s Collections / lambdas are everywhere, you feel like their API is really cumbersome.</li>
30
-
<li>You feel even more so if you know and love Groovy or JavaScript / lodash.</li>
31
-
<li>It perfectly fits unit tests where fluid, maintainable code is key.</li>
29
+
<li>Although Java’s Collections / lambdas are everywhere, you feel like their API is really cumbersome.</li>
30
+
<li>You feel even more so if you know and love Groovy or JavaScript / lodash.</li>
31
+
<li>It perfectly fits unit tests where fluid, maintainable code is key.</li>
32
32
</ul>
33
33
34
34
<p>Other benefits:</p>
35
35
36
36
<ul>
37
-
<li>Small footprint (JAR < 85KB), no other dependencies.</li>
38
-
<li>Thoroughly tested (coverage > 80%).</li>
39
-
<li>Human-readable documentation (here and in the API docs).</li>
40
-
<li>Free & Open source (<ahref="https://github.com/codebulb/LambdaOmega/blob/master/LICENSE">New BSD license</a>).</li>
37
+
<li>Small footprint (JAR < 85KB), no other dependencies.</li>
38
+
<li>Thoroughly tested (coverage > 80%).</li>
39
+
<li>Human-readable documentation (here and in the API docs).</li>
40
+
<li>Free & Open source (<ahref="https://github.com/codebulb/LambdaOmega/blob/master/LICENSE">New BSD license</a>).</li>
41
41
</ul>
42
42
43
-
<h2><aid="user-content-how-to-use-it" class="anchor" href="#how-to-use-it" aria-hidden="true"><spanclass="octicon octicon-link"></span></a>How to use it</h2>
43
+
<h2><aaria-hidden="true" href="#how-to-use-it" class="anchor" id="user-content-how-to-use-it"><spanclass="octicon octicon-link"></span></a>How to use it</h2>
44
44
45
45
<p>Use <ahref="https://jitpack.io/">JitPack</a> to add its dependency to your Maven project:</p>
<p>Replace the version by the tag / commit hash of your choice or <code>-SNAPSHOT</code> to get the newest SNAPSHOT. Visit <ahref="https://jitpack.io/docs/">JitPack's docs</a> for more information.</p>
54
+
<p>Replace the version by the tag / commit hash of your choice or <code>-SNAPSHOT</code> to get the newest SNAPSHOT.</p>
55
55
56
-
<h2><aid="user-content-getting-started-with-collections" class="anchor" href="#getting-started-with-collections" aria-hidden="true"><spanclass="octicon octicon-link"></span></a>Getting started with Collections</h2>
56
+
<p>Not using Maven? You can <ahref="https://jitpack.io/com/github/codebulb/LambdaOmega/0.1/LambdaOmega-0.1.jar">download the JAR directly from JitPack’s servers</a>.</p>
57
+
58
+
<p>Visit <ahref="https://jitpack.io/docs/">JitPack’s docs</a> for more information.</p>
59
+
60
+
<h2><aaria-hidden="true" href="#getting-started-with-collections" class="anchor" id="user-content-getting-started-with-collections"><spanclass="octicon octicon-link"></span></a>Getting started with Collections</h2>
57
61
58
62
<p>The heart of LambdaOmega are the wrapper classes <code>L</code> and <code>M</code> which wrap around vanilla Java Collection <code>List</code> or <code>Map</code>, respectively (decorator pattern) to provide a more concise and more enjoyable API to the underlying collection.
59
63
You can wrap an L around everything which can be turned into a List: a List, a <code>Stream</code>, varargs:</p>
<p>There are a lot of additional methods for L and M. For more information, visit the API docs.</p>
174
178
175
-
<h2><aid="user-content-a-list-is-a-map-and-a-map-is-a-list" class="anchor" href="#a-list-is-a-map-and-a-map-is-a-list" aria-hidden="true"><spanclass="octicon octicon-link"></span></a>A List is a Map and a Map is a List</h2>
179
+
<h2><aaria-hidden="true" href="#a-list-is-a-map-and-a-map-is-a-list" class="anchor" id="user-content-a-list-is-a-map-and-a-map-is-a-list"><spanclass="octicon octicon-link"></span></a>A List is a Map and a Map is a List</h2>
176
180
177
181
<p>Now comes the fun part. Because the LambdaOmega API lives independently of vanilla Java Collection / Map API, it features its own API which is more simple, consistent and powerful at the same time, whilst keeping it as close to the original Java APIs as possible.</p>
<h2><aid="user-content-collection-methods-with-lambdas" class="anchor" href="#collection-methods-with-lambdas" aria-hidden="true"><spanclass="octicon octicon-link"></span></a>Collection methods with Lambdas</h2>
204
+
<h2><aaria-hidden="true" href="#collection-methods-with-lambdas" class="anchor" id="user-content-collection-methods-with-lambdas"><spanclass="octicon octicon-link"></span></a>Collection methods with Lambdas</h2>
201
205
202
206
<p>One of the main reasons to use LambdaOmega are the simplifications to use collections with lambda expressions in functional programming. When compared with vanilla Java lambda use, the API is much more simple and concise. Many of these modifications are inspired by the equivalent Groovy semantics.</p>
<p>The <code>F</code> class serves as a simple wrapper around any kind of <code>FunctionalInterface</code>, providing a unified API to any kind of function:</p>
<p>This library also features a drop-in-replacement for CompletableFuture, simplifying and fixing its partially flawed API. I went into some more details in the <ahref="http://www.codebulb.ch/2015/08/lambdaomega-java-collections-lambdas-promises-simplified.html#drop-in-replacement">accompanying blog post</a>.</p>
300
304
301
-
<h2><aid="user-content-project-status-and-future-plans" class="anchor" href="#project-status-and-future-plans" aria-hidden="true"><spanclass="octicon octicon-link"></span></a>Project status and future plans</h2>
305
+
<h2><aaria-hidden="true" href="#things-to-consider-and-best-practices" class="anchor" id="user-content-things-to-consider-and-best-practices"><spanclass="octicon octicon-link"></span></a>Things to consider and Best practices</h2>
306
+
307
+
<ul>
308
+
<li><strong>Performance</strong>: LambdaOmega doesn’t make use of reflection. It really just wraps Collection API method calls and should perform similarly to vanilla API calls.
309
+
310
+
<ul>
311
+
<li>However, intermediate operations on LambdaOmega collections will always create a new Collection much unlike vanilla Java collections which just operate on a stream: <code>l(0, 1, 2).Map(it -> it + 1).map(it -> it * 2); // Creates a new Collection on #l(…), #Map(…) and #map(…)</code> This may decrease performance for big collections. Thus, even though LambdaOmega should perform OK in everyday situations, keep in mind that it is not and will never be built primarily for speed.</li>
312
+
</ul></li>
313
+
<li>LambdaOmega is not built as a replacement for any of the Java core classes / interfaces. It’s hence best practice to use LambdaOmega collections and other abstractions locally only for the coder’s convenience and to not expose them in a public API to reduce dependency on this library.</li>
314
+
<li>However, LambdaOmega fits perfectly where you make intense use of Java’s collection API and keeping your code clean and concise is key. It’s thus especially useful for e.g. JUnit test code which typically involves lots of collection boilerplate code.</li>
315
+
</ul>
316
+
317
+
<h2><aaria-hidden="true" href="#project-status-and-future-plans" class="anchor" id="user-content-project-status-and-future-plans"><spanclass="octicon octicon-link"></span></a>Project status and future plans</h2>
302
318
303
-
<p>As of V. 0.1 RC-2, RELEASE is imminent, and feedback is welcome.</p>
319
+
<p>LambdaOmega is now RELEASED, feedback is welcome.</p>
304
320
305
-
<p>Please feel free to submit bug reports / feature requests or make your own contribution to the project.</p>
321
+
<p>I will use the issue tracker to plan features for future releases. Feel free to use it to submit feature requests or bug reports, or make your own contribution to the project.</p>
306
322
307
323
<p>This is a private project I’ve started for my own pleasure and usage and to learn more about Java 8’s collection API, and I have no plans for (commercial) support. I decided to publish it open sourced so that everyone who is interested is free to use it at his own discretion.</p>
308
324
309
-
<h2><aid="user-content-for-more-information" class="anchor" href="#for-more-information" aria-hidden="true"><spanclass="octicon octicon-link"></span></a>For more information</h2>
<li><ahref="https://github.com/codebulb/LambdaOmega/issues/1">F enhancements</a>: Support for all <code>FunctionalInterface</code>s and more transformations in the <code>F</code> class.</li>
332
+
</ul></li>
333
+
<li>V. 0.1: First release</li>
334
+
</ul>
335
+
336
+
<h2><aaria-hidden="true" href="#for-more-information" class="anchor" id="user-content-for-more-information"><spanclass="octicon octicon-link"></span></a>For more information</h2>
310
337
311
338
<p>Please visit the <strong><ahref="http://www.codebulb.ch/2015/08/lambdaomega-java-collections-lambdas-promises-simplified.html">accompanying blog post</a></strong> to learn more about why I created this library or check out the API docs:</p>
0 commit comments