Skip to content

Commit

Permalink
Merge pull request #31 from avegera/SU-15
Browse files Browse the repository at this point in the history
#15 - Updated readme-file
  • Loading branch information
avegera authored May 18, 2023
2 parents 495d02a + 37a4ed4 commit 0ee22ce
Showing 1 changed file with 5 additions and 49 deletions.
54 changes: 5 additions & 49 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ Maven::
<dependency>
<groupId>io.github.avegera</groupId>
<artifactId>stream-utils</artifactId>
<version>0.1.0</version>
<version>0.2.0</version>
</dependency>
----
Gradle::
+
[source,groovy]
----
implementation 'io.github.avegera:stream-utils:0.1.0'
implementation 'io.github.avegera:stream-utils:0.2.0'
----
====

Expand All @@ -61,59 +61,15 @@ implementation 'io.github.avegera:stream-utils:0.1.0'

* https://github.com/avegera/stream-utils/wiki[Wiki Documentation]

== Utilities List

The list of library classes:

[plantuml, diagram-classes, png]
....
hide fields
skinparam monochrome true
skinparam defaultFontName JetBrains Mono
class SafeStreamUtils {
* safeStream()
* safeStreamFunction()
}
class StreamUtils {
* map()
* mapToSet()
* filter()
* filterToSet()
* flatMap()
* flatMapToSet()
* flatMapCollections()
* flatMapCollectionsToSet()
* distinct()
* distinctToSet()
* collectToList()
* collectToSet()
* sort()
* sortToSet()
* count()
* findFirst()
* findFirstOrDefault()
* findFirstOrNull()
* findAny()
* findAnyOrDefault()
* findAnyOrNull()
* allMatch()
* anyMatch()
* noneMatch()
}
SafeStreamUtils <--right-- StreamUtils : uses
....

=== SafeStreamUtils
=== Streams
`Streams` contains NPE-safety methods for stream instantiating by provided input data. For example, the following method returns stream of users (or empty stream in case when `users == null`):

[source,java]
----
Stream<User> stream = safeStream(users);
----

=== StreamUtils
=== Lists
`Lists` contains NPE-safety method-aliases for common Stream API intermediate operations like:

* map()
Expand All @@ -122,7 +78,7 @@ Stream<User> stream = safeStream(users);
* distinct()
* sort()

By default, the result of all operations is a `List`. Use suffix `...ToSet()` in method name to return `Set` instead. For example, the following method returns list of groups:
By default, the result of operations is a `List`. Use suffix `...ToSet()` in method name to return `Set` instead. For example, the following method returns list of groups:

[source,java]
----
Expand Down

0 comments on commit 0ee22ce

Please sign in to comment.