{"id":24568148,"url":"https://github.com/ilubenets/require","last_synced_at":"2025-03-17T04:46:45.907Z","repository":{"id":57720213,"uuid":"122363498","full_name":"iLubenets/require","owner":"iLubenets","description":"Lightweight assertion library with predefined messages","archived":false,"fork":false,"pushed_at":"2022-01-21T09:38:52.000Z","size":102,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-14T19:19:45.440Z","etag":null,"topics":["assert","java-8","precondition"],"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/iLubenets.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-21T16:43:14.000Z","updated_at":"2024-04-14T19:19:45.440Z","dependencies_parsed_at":"2022-09-26T21:41:19.621Z","dependency_job_id":null,"html_url":"https://github.com/iLubenets/require","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iLubenets%2Frequire","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iLubenets%2Frequire/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iLubenets%2Frequire/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iLubenets%2Frequire/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iLubenets","download_url":"https://codeload.github.com/iLubenets/require/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235294048,"owners_count":18966675,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["assert","java-8","precondition"],"created_at":"2025-01-23T14:19:56.440Z","updated_at":"2025-01-23T14:19:57.414Z","avatar_url":"https://github.com/iLubenets.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# require\n\nLightweight assertion library with predefined messages.\n\n[CHANGELOG.md](/CHANGELOG.md)\n\n## Methods\n\nAll methods produce exception **IllegalArgumentException** in the case if statement false. All methods return given\nvalue back without any modifications.\n\n| Method                    | Description                 |\n|---------------------------|-----------------------------|\n| Require.nonNull           | Check if value is not null. |\n| Require.nonBlank          | Check if value is not null and not blank, contains any character different from whitespace |\n| Require.nonEmpty          | Check if string or collection is not null and not empty |\n| Require.length            | Check if value is not null and has length between minLength and maxLength |\n| Require.maxLength         | Check if value is not null and has length between 0 and maxLength |\n| Require.minLength         | Check if value is not null and has length more then minLength |\n| Require.nonBlankMaxLength | Check if value is not blank and has length between 1 and maxLength |\n| Require.format            | Check if value is not null and has match regexp pattern format |\n| Require.positive          | Check if numeric value is not null and positive |\n| Require.negative          | Check if numeric value is not null and negative |\n| Require.gtThanZero        | Check if numeric is not null and grate than 0 |\n| Require.lsThanZero        | Check if numeric is not null and less than 0 |\n\n## Example\n\n```\npublic final class RequestId {\n\n    private final String value;\n\n    public RequestId(@Nullable final String value) {\n        this.value = Require.nonBlank(value, \"requestId\");\n    }\n\n    @Nonnull\n    public String value() {\n        return value;\n    }\n}\n```\n\n## Usage\n\nLibrary is available on [MavenCentral](https://search.maven.org/artifact/com.github.ilubenets/require).\n\nApache Maven:\n\n```\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.github.ilubenets\u003c/groupId\u003e\n  \u003cartifactId\u003erequire\u003c/artifactId\u003e\n  \u003cversion\u003e1.3\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nGradle Groovy DSL:\n\n```\ndependencies {\n    implementation 'com.github.ilubenets:require:1.3'\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filubenets%2Frequire","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Filubenets%2Frequire","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filubenets%2Frequire/lists"}