Stream Utility

The helper class for working with Java 8 streams

Лицензия

Лицензия

Группа

Группа

org.jmmo
Идентификатор

Идентификатор

stream-util
Последняя версия

Последняя версия

1.13
Дата

Дата

Тип

Тип

jar
Описание

Описание

Stream Utility
The helper class for working with Java 8 streams
Ссылка на сайт

Ссылка на сайт

https://github.com/Megaprog/stream-util
Система контроля версий

Система контроля версий

https://github.com/Megaprog/stream-util

Скачать stream-util

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.jmmo/stream-util/ -->
<dependency>
    <groupId>org.jmmo</groupId>
    <artifactId>stream-util</artifactId>
    <version>1.13</version>
</dependency>
// https://jarcasting.com/artifacts/org.jmmo/stream-util/
implementation 'org.jmmo:stream-util:1.13'
// https://jarcasting.com/artifacts/org.jmmo/stream-util/
implementation ("org.jmmo:stream-util:1.13")
'org.jmmo:stream-util:jar:1.13'
<dependency org="org.jmmo" name="stream-util" rev="1.13">
  <artifact name="stream-util" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.jmmo', module='stream-util', version='1.13')
)
libraryDependencies += "org.jmmo" % "stream-util" % "1.13"
[org.jmmo/stream-util "1.13"]

Зависимости

test (2)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.13.1
org.hamcrest : hamcrest-junit jar 2.0.0.0

Модули Проекта

Данный проект не имеет модулей.

Maven Central

Stream Utility

The helper class for working with Java 8 streams. It allows to create streams from Optional, from Supplier, from Matcher etc.

How to use it?

To create stream from supplier function:

Stream<Object> stream = StreamUtil.supply(() -> hasData() ? read() : null);

To create files stream (all files in directory and subdirectories):

Stream<Path> files = StreamUtil.files("myDirectory");

To wrap lambdas throws checked exceptions:

void method(int a, String b) throws IOException, InterruptedException { }

boolean isSomething(int a, String b) throws IOException, TimeoutException { return true; }

public void testUnchecked_Throw() throws Exception {
    Stream.of(1)
        .filter(i1 -> StreamUtil.unchecked(() -> isSomething(i1, "1")))
        .forEach(i2 -> StreamUtil.unchecked(() -> method(i2, "2")));
}

To wrap lambdas throws InterruptedException:

StreamUtil.uninterrupted(() -> Thread.sleep(1));

To logging expensive expressions:

log.debug("Debugging of {}", LazyToString.of(() -> "some expensive expression"));

Версии библиотеки

Версия
1.13
1.12
1.11
1.10
1.9
1.8
1.7.1
1.7
1.6
1.5
1.4
1.3
1.2
1.1
1.0