{"id":38329246,"url":"https://github.com/npathai/hamcrest-optional","last_synced_at":"2026-01-17T02:48:42.499Z","repository":{"id":34756772,"uuid":"38737973","full_name":"npathai/hamcrest-optional","owner":"npathai","description":"Matchers for JDK 8 Optional","archived":false,"fork":false,"pushed_at":"2022-06-03T15:34:52.000Z","size":46,"stargazers_count":43,"open_issues_count":1,"forks_count":3,"subscribers_count":5,"default_branch":"master","last_synced_at":"2023-10-30T11:52:54.038Z","etag":null,"topics":["assertion-library","assertions","hamcrest","java-8","junit4","junit5","matcher","optional"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/npathai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"License.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-08T07:08:00.000Z","updated_at":"2023-10-30T11:52:54.038Z","dependencies_parsed_at":"2022-09-26T21:50:24.456Z","dependency_job_id":null,"html_url":"https://github.com/npathai/hamcrest-optional","commit_stats":null,"previous_names":[],"tags_count":2,"template":null,"template_full_name":null,"purl":"pkg:github/npathai/hamcrest-optional","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npathai%2Fhamcrest-optional","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npathai%2Fhamcrest-optional/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npathai%2Fhamcrest-optional/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npathai%2Fhamcrest-optional/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/npathai","download_url":"https://codeload.github.com/npathai/hamcrest-optional/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npathai%2Fhamcrest-optional/sbom","scorecard":{"id":696098,"data":{"date":"2025-08-11","repo":{"name":"github.com/npathai/hamcrest-optional","commit":"591c782260470c4d2731c53aaed27631b867e0cf"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"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":-1,"reason":"no dependencies found","details":null,"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":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"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":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"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":"Dangerous-Workflow","score":-1,"reason":"no workflows found","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":"Code-Review","score":3,"reason":"Found 7/23 approved changesets -- score normalized to 3","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":"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":"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: License.txt:0","Info: FSF or OSI recognized license: MIT License: License.txt: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":-1,"reason":"no releases found","details":null,"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":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 14 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-22T03:45:05.224Z","repository_id":34756772,"created_at":"2025-08-22T03:45:05.224Z","updated_at":"2025-08-22T03:45:05.224Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28492590,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T02:39:23.645Z","status":"ssl_error","status_checked_at":"2026-01-17T02:34:19.649Z","response_time":85,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["assertion-library","assertions","hamcrest","java-8","junit4","junit5","matcher","optional"],"created_at":"2026-01-17T02:48:42.410Z","updated_at":"2026-01-17T02:48:42.481Z","avatar_url":"https://github.com/npathai.png","language":"Java","readme":"# Hamcrest Optional\n[![Travis CI build](https://travis-ci.org/npathai/hamcrest-optional.svg?branch=master)](https://travis-ci.org/npathai/hamcrest-optional)   [![Coverage Status](https://coveralls.io/repos/npathai/hamcrest-optional/badge.svg?branch=master\u0026service=github)](https://coveralls.io/github/npathai/hamcrest-optional?branch=master)\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.npathai/hamcrest-optional/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.github.npathai/hamcrest-optional)\n[![MIT license](http://img.shields.io/badge/license-MIT-brightgreen.svg)](https://github.com/npathai/hamcrest-optional/blob/master/License.txt)\n\nAn extension to [Java Hamcrest](https://github.com/hamcrest/JavaHamcrest) which provides matchers for `java.util.Optional`.\n\n## Maven Dependency\n\n### Version 2.0.0 - Latest\n\nChanges\n\n - Methods renamed from `hasValue` to `isPresentAndIs/isPresentAnd` for better fluency.\n```\n\u003cdependencies\u003e\n...\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.github.npathai\u003c/groupId\u003e\n  \u003cartifactId\u003ehamcrest-optional\u003c/artifactId\u003e\n  \u003cversion\u003e2.0.0\u003c/version\u003e\n\u003c/dependency\u003e\n...\n\u003c/dependencies\u003e\n```\n\n### Version 1.0\n\n```\n\u003cdependencies\u003e\n...\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.github.npathai\u003c/groupId\u003e\n  \u003cartifactId\u003ehamcrest-optional\u003c/artifactId\u003e\n  \u003cversion\u003e1.0\u003c/version\u003e\n\u003c/dependency\u003e\n...\n\u003c/dependencies\u003e\n```\n\n## Usage\n\nhamcrest-optional provides four matchers for `Optional`: `isEmpty()`,\n`isPresent()`, `isPresentAndIs(Object)` and `isPresentAnd(Matcher)`.\n\n### isEmpty()\n\nThis matcher matches when the examined `Optional` contains no value.\n\n```java\nimport static com.github.npathai.hamcrestopt.OptionalMatchers.isEmpty;\n\nOptional\u003cObject\u003e optional = Optional.empty();\nassertThat(optional, isEmpty());\n```\n\n### isPresent()\n\nThis matcher matches when the examined `Optional` contains a value.\n\n```java\nimport static com.github.npathai.hamcrestopt.OptionalMatchers.isPresent;\n\nOptional\u003cString\u003e optional = Optional.of(\"dummy value\");\nassertThat(optional, isPresent());\n```\n\n### isPresentAndIs(Object)\n\nThis matcher matches when the examined `Optional` contains a value that is\nlogically equal to the specified object.\n\n```java\nimport static com.github.npathai.hamcrestopt.OptionalMatchers.isPresentAndIs;\n\nOptional\u003cString\u003e optional = Optional.of(\"dummy value\");\nassertThat(optional, isPresentAndIs(\"dummy value\"));\n```\n\n### isPresentAnd(Matcher)\n\nThis matcher matches when the examined `Optional` contains a value that\nsatisfies the specified matcher.\n\n```java\nimport static com.github.npathai.hamcrestopt.OptionalMatchers.isPresentAnd;\nimport static org.hamcrest.Matchers.startsWith;\n\nOptional\u003cString\u003e optional = Optional.of(\"dummy value\");\nassertThat(optional, isPresentAnd(startsWith(\"dummy\")));\n```\n\n## Development Guide\n\nhamcrest-optional is build with [Maven](http://maven.apache.org/). If you want\nto contribute code then\n\n* Please write a test for your change.\n* Ensure that you don't break the build by running `mvn verify -Dgpg.skip`.\n* Fork the repo and create a pull request. (See [Understanding the GitHub Flow](https://guides.github.com/introduction/flow/index.html))\n\nhamcrest-optional supports [Travis CI](https://travis-ci.org/) for continuous\nintegration. Your pull request is automatically build by Travis CI.\n\n## Release Guide\n\n* Select a new version according to the\n  [Semantic Versioning 2.0.0 Standard](http://semver.org/).\n* Set the new version in `pom.xml`.\n* Commit the modified `pom.xml`.\n* Push the commit: `git push origin master`\n* Run `mvn clean deploy` with JDK 8.\n* Add a tag for the release: `git tag hamcrest-optional-X.X.X`\n* Push the tag: `git push origin hamcrest-optional-X.X.X`\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnpathai%2Fhamcrest-optional","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnpathai%2Fhamcrest-optional","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnpathai%2Fhamcrest-optional/lists"}