{"id":37022545,"url":"https://github.com/ioweyou/iou-java","last_synced_at":"2026-01-14T02:41:43.891Z","repository":{"id":57737981,"uuid":"56619841","full_name":"ioweyou/iou-java","owner":"ioweyou","description":"IOU for Java - Promises/A+ implementation for Java","archived":true,"fork":false,"pushed_at":"2017-03-02T07:40:58.000Z","size":14,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-23T13:51:09.704Z","etag":null,"topics":["aplus","iou","java","promise"],"latest_commit_sha":null,"homepage":"https://ioweyou.github.io","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/ioweyou.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-04-19T18:05:53.000Z","updated_at":"2023-01-28T09:51:59.000Z","dependencies_parsed_at":"2022-08-24T14:42:28.077Z","dependency_job_id":null,"html_url":"https://github.com/ioweyou/iou-java","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ioweyou/iou-java","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ioweyou%2Fiou-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ioweyou%2Fiou-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ioweyou%2Fiou-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ioweyou%2Fiou-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ioweyou","download_url":"https://codeload.github.com/ioweyou/iou-java/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ioweyou%2Fiou-java/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408712,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T01:52:23.358Z","status":"online","status_checked_at":"2026-01-14T02:00:06.678Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["aplus","iou","java","promise"],"created_at":"2026-01-14T02:41:43.248Z","updated_at":"2026-01-14T02:41:43.881Z","avatar_url":"https://github.com/ioweyou.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--\nThe MIT License (MIT)\n\nCopyright (c) 2016 Ely Deckers\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n--\u003e\n\n# IOU Java\n\n[![Travis CI](https://travis-ci.org/ioweyou/iou-java.svg)](https://travis-ci.org/ioweyou/iou-java)\n[![License MIT](https://img.shields.io/:license-mit-blue.svg)](http://badges.mit-license.org)\n\n\u003ca href=\"https://promisesaplus.com/\"\u003e\n    \u003cimg src=\"https://promisesaplus.com/assets/logo-small.png\" alt=\"Promises/A+ logo\"\n         title=\"Promises/A+ 1.0 compliant\" align=\"right\" /\u003e\n\u003c/a\u003e\nIOU Java is a [Promises/A+](https://github.com/promises-aplus/promises-spec) compliant promise library that extends [IOU Core](https://github.com/ioweyou/iou-core).\n\n## Maven\n-----\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003enl.brusque.iou\u003c/groupId\u003e\n    \u003cartifactId\u003eiou-java\u003c/artifactId\u003e\n    \u003cversion\u003e1.0.0-beta-01\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## Gradle\n-----\n```\ncompile 'nl.brusque.iou:iou-java:1.0.0-beta-01' { transitive = true }\n```\n\n## Example\n-----\n### Call with single then\n\n```java\nIOU\u003cInteger\u003e iou = new IOU\u003c\u003e();\n\niou.getPromise()\n        .then(new IThenCallable\u003cInteger, Void\u003e() {\n            @Override\n            public Void apply(Integer input) throws Exception {\n                System.out.println(input.toString());\n\n                return null;\n            }\n        });\n\niou.resolve(42); // prints \"42\"\n```\n\n### Chained or piped promise\n```java\nIOU\u003cInteger\u003e iou = new IOU\u003c\u003e();\n\niou.getPromise()\n        .then(new IThenCallable\u003cInteger, Integer\u003e() {\n            @Override\n            public Integer apply(Integer input) throws Exception {\n                return input * 10;\n            }\n        })\n        .then(new IThenCallable\u003cInteger, String\u003e() {\n            @Override\n            public String apply(Integer input) throws Exception {\n                return String.format(\"The result: %d\", input);\n            }\n        })\n        .then(new IThenCallable\u003cString, Void\u003e() {\n            @Override\n            public Void apply(String input) throws Exception {\n                System.out.println(input);\n\n                return null;\n            }\n        });\n\niou.resolve(42); // prints \"The result: 420\"\n```\n### Rejecting a promise\n```java\nIOU\u003cInteger\u003e iou = new IOU\u003c\u003e();\n\niou.getPromise()\n        .then(new IThenCallable\u003cInteger, Integer\u003e() {\n            @Override\n            public Integer apply(Integer integer) throws Exception {\n                return integer * 42;\n            }\n        })\n        .fail(new IThenCallable\u003cObject, Void\u003e() {\n            @Override\n            public Void apply(Object input) throws Exception {\n                System.out.println(String.format(\"%s I can't do that.\", input));\n\n                return null;\n            }\n        });\n\niou.reject(\"I'm sorry, Dave.\"); // prints \"I'm sorry, Dave. I can't do that.\"\n```\nOr if you like the A+ way better\n```java\nIOU\u003cInteger\u003e iou = new IOU\u003c\u003e();\n\niou.getPromise()\n        .then(new IThenCallable\u003cInteger, Integer\u003e() {\n            @Override\n            public Integer apply(Integer input) throws Exception {\n                return input * 42;\n            }\n        }, new IThenCallable\u003cObject, Integer\u003e() {\n            @Override\n            public Integer apply(Object input) throws Exception {\n                System.out.println(String.format(\"%s I can't do that.\", input));\n\n                return null;\n            }\n        });\n\niou.reject(\"I'm sorry, A+.\"); // prints \"I'm sorry, A+. I can't do that.\"\n```\n### Failing a promise\n```java\nIOU\u003cInteger\u003e iou = new IOU\u003c\u003e();\n\niou.getPromise()\n        .then(new IThenCallable\u003cInteger, Integer\u003e() {\n            @Override\n            public Integer apply(Integer input) throws Exception {\n                throw new Exception(\"I just don't care.\");\n            }\n        })\n        .then(new IThenCallable\u003cInteger, Void\u003e() {\n            @Override\n            public Void apply(Integer input) throws Exception {\n                System.out.println(\"What would you say you do here?\");\n\n                return null;\n            }\n        })\n        .fail(new IThenCallable\u003cObject, Void\u003e() {\n            @Override\n            public Void apply(Object reason) throws Exception {\n                System.out.println(\n                    String.format(\"It's not that I'm lazy, it's that %s\",\n                            ((Exception)reason).getMessage()));\n\n                return null;\n            }\n        });\n\niou.resolve(42); // prints \"It's not that I'm lazy, it's that I just don't care.\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fioweyou%2Fiou-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fioweyou%2Fiou-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fioweyou%2Fiou-java/lists"}