Lazy4J

A generic Lazy class in java

Лицензия

Лицензия

Группа

Группа

nl.talsmasoftware
Идентификатор

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

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

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

1.0.2
Дата

Дата

Тип

Тип

jar
Описание

Описание

Lazy4J
A generic Lazy class in java
Ссылка на сайт

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

https://github.com/talsma-ict/lazy4j
Организация-разработчик

Организация-разработчик

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

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

https://github.com/talsma-ict/lazy4j.git

Скачать lazy4j

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

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

Зависимости

provided (1)

Идентификатор библиотеки Тип Версия
nl.talsmasoftware : umldoclet Необязательный jar 2.0.12

test (4)

Идентификатор библиотеки Тип Версия
org.junit.jupiter : junit-jupiter-engine jar 5.7.1
org.hamcrest : hamcrest jar 2.2
org.slf4j : jul-to-slf4j jar 1.7.30
ch.qos.logback : logback-classic jar 1.2.3

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

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

CI build Coverage Status Maven Version JavaDoc

Lazy4J

A generic Lazy class in java

What is it?

A small container class that takes a supplier function and evaluates it at most once, but not before the result is needed.
Lazy wraps the Supplier functional interface.

Why?

This is often recurring functionality that should have been provided out of the box by the JDK when lambda's were introduced in Java 8.

Fortunately, it's not very difficult to create, so that's what we did.

Example

A small example of how this class can be used:

public class Example {
    private final Lazy<Expensive> expensive = Lazy.lazy(Expensive::create);
}

This declares a lazy expensive variable without creating an expensive object yet.
Only when get() is called for the first time, the Expensive.create() method is called.
All subsequent invocations will return the same instance of Expensive.

Lazy provides isAvailable, map, flatMap, ifAvailable functions.
Please refer to the Lazy class documentation for full descriptions.

Getting the class

Add the following dependency to your project or download it directly from github:

Maven

<dependency>
    <groupId>nl.talsmasoftware</groupId>
    <artifactId>lazy4j</artifactId>
    <version>[see maven badge]</version>
</dependency>

Gradle

compile 'nl.talsmasoftware:lazy4j:[see maven-central badge]'

Scala

libraryDependencies += "nl.talsmasoftware" % "lazy4j" % "[see maven-central badge]"

License

Apache 2.0 license

nl.talsmasoftware

Talsma ICT

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

Версия
1.0.2
1.0.1
1.0.0
0.3.0
0.2.0
0.1.0