{"id":13524468,"url":"https://github.com/ic4j/ic4j-candid","last_synced_at":"2026-01-14T02:09:19.580Z","repository":{"id":57739382,"uuid":"448140724","full_name":"ic4j/ic4j-candid","owner":"ic4j","description":"Java Candid for The Internet Computer (IC4J) is a set of native Java libraries to manage the Internet Computer Candid types","archived":false,"fork":false,"pushed_at":"2025-05-21T17:32:06.000Z","size":254,"stargazers_count":3,"open_issues_count":2,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-21T18:46:56.671Z","etag":null,"topics":["android","dfinity","icp","jackson","java","jaxb","jdbc","json","xml"],"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/ic4j.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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}},"created_at":"2022-01-15T00:05:47.000Z","updated_at":"2025-05-21T17:32:10.000Z","dependencies_parsed_at":"2023-12-01T01:30:28.759Z","dependency_job_id":"403f6041-1447-436f-a5e2-c20c58008cfe","html_url":"https://github.com/ic4j/ic4j-candid","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ic4j/ic4j-candid","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ic4j%2Fic4j-candid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ic4j%2Fic4j-candid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ic4j%2Fic4j-candid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ic4j%2Fic4j-candid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ic4j","download_url":"https://codeload.github.com/ic4j/ic4j-candid/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ic4j%2Fic4j-candid/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408711,"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":["android","dfinity","icp","jackson","java","jaxb","jdbc","json","xml"],"created_at":"2024-08-01T06:01:10.365Z","updated_at":"2026-01-14T02:09:19.575Z","avatar_url":"https://github.com/ic4j.png","language":"Java","funding_links":[],"categories":["Candid"],"sub_categories":["Candid implementations"],"readme":"# dfinity-agent\nJava Candid for The Internet Computer (IC4J) is a collection of open-source native Java libraries designed to handle Candid types on the Internet Computer.\nFull documentation \u003ca href=\"https://docs.ic4j.com\"\u003e\nhere\u003c/a\u003e\n\n\u003ca href=\"https://dfinity.org/\"\u003e\nhttps://dfinity.org/\n\u003c/a\u003e\n\nThe code is implementation of the Internet Computer Interface protocol \n\n\u003ca href=\"https://sdk.dfinity.org/docs/interface-spec/index.html\"\u003e\nhttps://sdk.dfinity.org/docs/interface-spec/index.html\n\u003c/a\u003e\n\nand it's using Dfinity Rust agent as an inspiration, using similar package structures and naming conventions.\n\n\u003ca href=\"https://github.com/dfinity/agent-rs\"\u003e\nhttps://github.com/dfinity/agent-rs\n\u003c/a\u003e\n\n\n# License\n\nIC4J Candid is available under Apache License 2.0.\n\n# Documentation\n\n## Supported type mapping between Java and Candid\n\n| Candid      | Java    |\n| :---------- | :---------- | \n| bool   | Boolean | \n| int| BigInteger   | \n| int8   | Byte | \n| int16   | Short | \n| int32   | Integer | \n| int64   | Long | \n| nat| BigInteger   | \n| nat8   | Byte | \n| nat16   | Short | \n| nat32   | Integer | \n| nat64   | Long |\n| float32   | Float, Double | \n| float64   | Double | \n| text   | String | \n| opt   | Optional | \n| principal   | Principal | \n| vec   | array, List | \n| record   | Map, Class | \n| variant   | Map, Enum | \n| func   | Func | \n| service   | Service | \n| null   |Null | \n\n\n## POJO Java class with Candid annotations\n\n```\nimport java.math.BigInteger;\n\nimport org.ic4j.candid.annotations.Field;\nimport org.ic4j.candid.annotations.Name;\nimport org.ic4j.candid.types.Type;\n\npublic class Pojo {\n\t@Field(Type.BOOL)\n\t@Name(\"bar\")\n\tpublic Boolean bar;\n\n\t@Field(Type.INT)\n\t@Name(\"foo\")\n\tpublic BigInteger foo;\n}\n```\n\n```\nPojo pojoValue = new Pojo();\n\t\t\t\t\npojoValue.bar = new Boolean(false);\npojoValue.foo = BigInteger.valueOf(43); \n\t\t\t\t\n```\n\n## JSON (Jackson) serialization and deserialization\n\nUse JacksonSerializer to serialize Jackson JsonNode or Jackson compatible Pojo class to Candid\n\n```\nJsonNode jsonValue;\nIDLType idlType;\n\nIDLValue idlValue = IDLValue.create(jsonValue, JacksonSerializer.create(idlType));\nList\u003cIDLValue\u003e args = new ArrayList\u003cIDLValue\u003e();\nargs.add(idlValue);\n\nIDLArgs idlArgs = IDLArgs.create(args);\n\nbyte[] buf = idlArgs.toBytes();\n```\n\nUse JacksonDeserializer to deserialize Candid to Jackson JsonNode or Jackson compatible Pojo class\n\n```\nJsonNode jsonResult = IDLArgs.fromBytes(buf).getArgs().get(0)\n\t.getValue(JacksonDeserializer.create(idlValue.getIDLType()), JsonNode.class);\n```\n\n## XML (DOM) serialization and deserialization\n\nUse DOMSerializer to serialize DOM Node to Candid\n\n```\nNode domValue;\n\nIDLValue idlValue = IDLValue.create(domValue,DOMSerializer.create());\nList\u003cIDLValue\u003e args = new ArrayList\u003cIDLValue\u003e();\nargs.add(idlValue);\n\nIDLArgs idlArgs = IDLArgs.create(args);\n\nbyte[] buf = idlArgs.toBytes();\n```\n\nUse DOMDeserializer to deserialize Candid to DOM Node\n\n```\nDOMDeserializer domDeserializer = DOMDeserializer.create(idlValue.getIDLType()).rootElement(\"http://scaleton.com/dfinity/candid\",\"data\");\n\t\t\t\nNode domResult = IDLArgs.fromBytes(buf).getArgs().get(0).getValue(domDeserializer, Node.class);\n```\n\n## JDBC (ResultSet) serialization\n\nUse JDBCSerializer to serialize JDBC ResultSet to Candid\n\n```\nResultSet result = statement.executeQuery(sql);\n\t\t\t\nIDLValue idlValue = IDLValue.create(result, JDBCSerializer.create());\nList\u003cIDLValue\u003e args = new ArrayList\u003cIDLValue\u003e();\nargs.add(idlValue);\n\nIDLArgs idlArgs = IDLArgs.create(args);\n\nbyte[] buf = idlArgs.toBytes();\n```\n\n# Downloads / Accessing Binaries\n\nTo add Java IC4J Candid library to your Java project use Maven or Gradle import from Maven Central.\n\n\u003ca href=\"https://search.maven.org/artifact/ic4j/ic4j-candid/0.7.5/jar\"\u003e\nhttps://search.maven.org/artifact/ic4j/ic4j-candid/0.7.5/jar\n\u003c/a\u003e\n\n```\n\u003cdependency\u003e\n  \u003cgroupId\u003eorg.ic4j\u003c/groupId\u003e\n  \u003cartifactId\u003eic4j-candid\u003c/artifactId\u003e\n  \u003cversion\u003e0.7.5\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n```\nimplementation 'org.ic4j:ic4j-candid:0.7.5'\n```\n\n## Dependencies\n\nThis this is using these open source libraries\n\n\n### Jackson JSON Serializer and Deserializer\nTo manage Jackson objects.\n\n### Java CC\nTo parse IC IDL Candid files\n\n# Build\n\nYou need JDK 8+ to build IC4J Candid.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fic4j%2Fic4j-candid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fic4j%2Fic4j-candid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fic4j%2Fic4j-candid/lists"}