{"id":36596583,"url":"https://github.com/talsma-ict/lazy4j","last_synced_at":"2026-01-12T08:30:08.642Z","repository":{"id":33807849,"uuid":"131965866","full_name":"talsma-ict/lazy4j","owner":"talsma-ict","description":"Lazy value support for java","archived":false,"fork":false,"pushed_at":"2025-12-22T07:25:00.000Z","size":614,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-23T18:53:24.056Z","etag":null,"topics":["lazy","lazy-evaluation","lazy-loading","lazyloading"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/talsma-ict.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2018-05-03T08:36:08.000Z","updated_at":"2025-12-22T07:25:03.000Z","dependencies_parsed_at":"2026-01-07T13:08:17.884Z","dependency_job_id":null,"html_url":"https://github.com/talsma-ict/lazy4j","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/talsma-ict/lazy4j","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/talsma-ict%2Flazy4j","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/talsma-ict%2Flazy4j/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/talsma-ict%2Flazy4j/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/talsma-ict%2Flazy4j/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/talsma-ict","download_url":"https://codeload.github.com/talsma-ict/lazy4j/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/talsma-ict%2Flazy4j/sbom","scorecard":{"id":867040,"data":{"date":"2025-08-11","repo":{"name":"github.com/talsma-ict/lazy4j","commit":"a2b27b47388c9e29a51a9b9de5f91dca6de0599c"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":6,"checks":[{"name":"Code-Review","score":1,"reason":"Found 2/19 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":10,"reason":"20 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":9,"reason":"binaries present in source code","details":["Warn: binary detected: .mvn/wrapper/maven-wrapper.jar:1"],"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/build.yml:1","Warn: no topLevel permission defined: .github/workflows/deploy.yml:1","Warn: no topLevel permission defined: .github/workflows/release.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/talsma-ict/lazy4j/build.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/talsma-ict/lazy4j/build.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:30: update your workflow using https://app.stepsecurity.io/secureworkflow/talsma-ict/lazy4j/build.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/build.yml:42: update your workflow using https://app.stepsecurity.io/secureworkflow/talsma-ict/lazy4j/build.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/deploy.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/talsma-ict/lazy4j/deploy.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/deploy.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/talsma-ict/lazy4j/deploy.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/talsma-ict/lazy4j/release.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/talsma-ict/lazy4j/release.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:59: update your workflow using https://app.stepsecurity.io/secureworkflow/talsma-ict/lazy4j/release.yml/main?enable=pin","Info:   0 out of   7 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":8,"reason":"2 out of the last 2 releases have a total of 2 signed artifacts.","details":["Info: signed release artifact: lazy4j-2.0.2-javadoc.jar.asc: https://github.com/talsma-ict/lazy4j/releases/tag/2.0.2","Info: signed release artifact: lazy4j-2.0.1-javadoc.jar.asc: https://github.com/talsma-ict/lazy4j/releases/tag/2.0.1","Warn: release artifact 2.0.2 does not have provenance: https://api.github.com/repos/talsma-ict/lazy4j/releases/240216589","Warn: release artifact 2.0.1 does not have provenance: https://api.github.com/repos/talsma-ict/lazy4j/releases/214019696"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/deploy.yml:10"],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"SAST","score":10,"reason":"SAST tool detected","details":["Info: SAST configuration detected: Sonar","Warn: 6 commits out of 15 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-24T02:55:51.000Z","repository_id":33807849,"created_at":"2025-08-24T02:55:51.000Z","updated_at":"2025-08-24T02:55:51.000Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28337595,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T06:09:07.588Z","status":"ssl_error","status_checked_at":"2026-01-12T06:05:18.301Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["lazy","lazy-evaluation","lazy-loading","lazyloading"],"created_at":"2026-01-12T08:30:08.519Z","updated_at":"2026-01-12T08:30:08.634Z","avatar_url":"https://github.com/talsma-ict.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Maven Version][maven-img]][maven]\n[![JavaDoc][javadoc-img]][javadoc]\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=talsma-ict_lazy4j\u0026metric=alert_status)](https://sonarcloud.io/summary/new_code?id=talsma-ict_lazy4j)\n[![Coverage Status][coveralls-img]][coveralls]\n\n# Lazy4J\n\n- A `Lazy` class in java.\n- A `LazyValueMap`.\n- A `LazyList`\n\n## What is it?\n\n### Lazy\n\nWrapper for a standard java `Supplier` function that only evaluates the wrapped function when it is first needed,\nremembering the result so it does not need to get called again.\n\n### LazyValueMap\n\nMap that stores values as `Lazy` values.\n\n### LazyList\n\nList that stores values as `Lazy` values.\n\n## Why?\n\nWe feel this ought to be provided out of the box and should have been when lambda's were introduced, back in Java 8.\n\nFortunately, a `Lazy` class implementation is not very difficult to create, so that's what we did.  \nThe `LazyValueMap` was added later in version 2.0.2 and `LazyList` in 2.0.3.\n\n## Example\n\nA small example of how the `Lazy` class can be used:\n\n```java\npublic class Example {\n    // Method reference to constructor new Expensive(), called only when needed and keep the result.\n    private final Lazy\u003cExpensive\u003e lazyMethod = Lazy.of(Expensive::new);\n\n    // Lambda called only once when needed for the first time.\n    private final Lazy\u003cExpensive\u003e lazyLambda = Lazy.of(() -\u003e new Expensive());\n}\n```\n\nThis declares a lazy variable without calling the expensive supplier yet.  \nOnly when `get()` is called for the first time, the `new Expensive()` constructor is called.  \nAll subsequent invocations will return _the same_ instance of `Expensive`.\n\nLazy provides the following methods:\n- `isAvailable` returning whether the lazy value is already available. \n- `map` applies a function on the lazy result.\n- `flatMap` applies a function that itself returns a supplier.\n- `ifAvailable` runs a function only if the lazy value is already available.\n\nPlease refer to the [Lazy class documentation][lazy-javadoc-page] for full descriptions.\n\n### LazyValueMap example\n\n```java\n    // Map that stores lazy values that only get evaluated when they are needed for the first time.\n    private final LazyValueMap\u003cString, String\u003e lazyMap = new LazyValueMap(HashMap::new);\n    private final LazyValueMap\u003cString, String\u003e sortedLazyMap = new LazyValueMap(TreeMap::new);\n\n    lazyMap.putLazy(\"key\", () -\u003e new Expensive());\n```\n\nThe expensive value is only evaluated when the key is first accessed.\n\nThe lazy map offers the following lazy variants of standard map methods:\n- `getLazy`\n- `putLazy`\n- `lazyPutIfAbsent`\n- `lazyCompute`\n- `lazyComputeIfAbsent`\n- `lazyComputeIfPresent`\n- `lazyReplace`\n- `lazyMerge`\n- `lazyValues`\n\n### LazyList example\n\n```java\n    // List that stores lazy values that only get evaluated when they are needed for the first time.\n    LazyList\u003cExpensive\u003e lazyValues = LazyList.create();\n\n    lazyValues.addLazy(() -\u003e new Expensive(\"first\"));\n    lazyValues.addLazy(() -\u003e new Expensive(\"second\"));\n```\n\nThe expensive values are only evaluated when the values are first accessed.\n\nThe lazy list offers the following lazy variants of standard list methods:\n- getLazy / getFirstLazy / getLastLazy\n- setLazy\n- addLazy / addFirstLazy / addLastLazy / addAllLazy\n- streamLazy / streamAvailable / parallelStreamLazy / parallelStreamAvailable\n- replaceAll is performed lazily per value\n\nPlease be aware that certain operations such as `sort` or `hashCode` will trigger eager evaluation of all values in the list.\n\n## Getting the classes\n\nAdd the following dependency to your project\nor download it [directly from github](https://github.com/talsma-ict/lazy4j/releases):\n\n#### Maven\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003enl.talsmasoftware\u003c/groupId\u003e\n    \u003cartifactId\u003elazy4j\u003c/artifactId\u003e\n    \u003cversion\u003e[see maven badge]\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n#### Gradle\n\n```groovy\ncompile 'nl.talsmasoftware:lazy4j:[see maven-central badge]'\n```\n\n#### Scala\n\n```scala\nlibraryDependencies += \"nl.talsmasoftware\" % \"lazy4j\" % \"[see maven-central badge]\"\n```\n\n## License\n\n[Apache 2.0 license](LICENSE)\n\n\n  [maven-img]: \u003chttps://img.shields.io/maven-central/v/nl.talsmasoftware/lazy4j\u003e\n  [maven]: \u003chttp://mvnrepository.com/artifact/nl.talsmasoftware/lazy4j\u003e\n  [coveralls-img]: \u003chttps://coveralls.io/repos/github/talsma-ict/lazy4j/badge.svg\u003e\n  [coveralls]: \u003chttps://coveralls.io/github/talsma-ict/lazy4j\u003e\n  [javadoc-img]: \u003chttps://www.javadoc.io/badge/nl.talsmasoftware/lazy4j.svg\u003e\n  [javadoc]: \u003chttps://www.javadoc.io/doc/nl.talsmasoftware/lazy4j\u003e\n  [lazy-javadoc-page]: \u003chttps://javadoc.io/doc/nl.talsmasoftware/lazy4j/latest/nl.talsmasoftware.lazy4j/nl/talsmasoftware/lazy4j/Lazy.html\u003e\n  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftalsma-ict%2Flazy4j","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftalsma-ict%2Flazy4j","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftalsma-ict%2Flazy4j/lists"}