{"id":21593717,"url":"https://github.com/seedstack/coffig","last_synced_at":"2025-04-10T23:40:33.448Z","repository":{"id":52197720,"uuid":"52086445","full_name":"seedstack/coffig","owner":"seedstack","description":"Lightweight configuration library written in Java.","archived":false,"fork":false,"pushed_at":"2021-07-23T11:35:40.000Z","size":552,"stargazers_count":3,"open_issues_count":2,"forks_count":6,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-24T20:22:44.858Z","etag":null,"topics":["configuration","java","seedstack","yaml"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/seedstack.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":"2016-02-19T12:31:43.000Z","updated_at":"2023-01-16T23:06:21.000Z","dependencies_parsed_at":"2022-09-05T08:40:28.858Z","dependency_job_id":null,"html_url":"https://github.com/seedstack/coffig","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seedstack%2Fcoffig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seedstack%2Fcoffig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seedstack%2Fcoffig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seedstack%2Fcoffig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/seedstack","download_url":"https://codeload.github.com/seedstack/coffig/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248317732,"owners_count":21083525,"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":["configuration","java","seedstack","yaml"],"created_at":"2024-11-24T17:14:11.598Z","updated_at":"2025-04-10T23:40:33.429Z","avatar_url":"https://github.com/seedstack.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SeedStack config library \"Coffig\"\n\n[![Build status](https://travis-ci.org/seedstack/coffig.svg?branch=master)](https://travis-ci.org/seedstack/coffig) [![Coverage Status](https://coveralls.io/repos/seedstack/coffig/badge.svg?branch=master)](https://coveralls.io/r/seedstack/coffig?branch=master) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.seedstack.coffig/coffig/badge.svg?style=flat)](https://maven-badges.herokuapp.com/maven-central/org.seedstack.coffig/coffig)\n\nCoffig is a simple and powerful configuration library for the Java language. It is built upon the idea of mapping configuration trees to  Java objects. The following configuration tree in YAML:\n\n```yaml\nsome:\n  string: value1\n  array: [1, 2, 3]\n  object:\n    attr1: value1\n    attr2: [iris, jasmine, kiwi]\n```    \n        \nCan be retrieved as simply as:        \n\n```java\nCoffig coffig = Coffig.builder().withProviders(new JacksonProvider().addSource(\"url/to/file.yaml\")).build();\n    \nString stringValue = coffig.get(String.class, \"some.string\");\nint[] intArray = coffig.get(int[].class, \"some.array\");\nMyPojo myPojo = coffig.get(MyPojo.class, \"some.object\");\nString defaultValue = coffig.getOptional(String.class, \"unknown.node\").orElse(\"default\");\n```\n\n## Mapping    \n    \nCoffig is able to map any Java class by introspecting its members but can handle special cases with dedicated mappers. Mappers for several types are built-in: \n\n* Array, \n* List, \n* Set,\n* Map, \n* Enum, \n* Optional, \n* URI/URL,\n* Properties, \n* Class.\n\nYou can add you own mappers by implementing the `ConfigurationMapper` interface and registering it through the [ServiceLoader](http://docs.oracle.com/javase/8/docs/api/java/util/ServiceLoader.html) mechanism.\n\n## Providers\n\nMultiple providers can be used at once, each providing a separate configuration tree that will be merged into a global one. Several providers are built-in: \n\n* Jackson (for YAML and JSON sources), \n* Environment variables, \n* System properties.\n\nYou can add you own mappers by implementing the `ConfigurationProvider` interface and registering it through the [ServiceLoader](http://docs.oracle.com/javase/8/docs/api/java/util/ServiceLoader.html) mechanism.\n\n# Copyright and license\n\nThis source code is copyrighted by [The SeedStack Authors](https://github.com/seedstack/seedstack/blob/master/AUTHORS) and\nreleased under the terms of the [Mozilla Public License 2.0](https://www.mozilla.org/MPL/2.0/). \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseedstack%2Fcoffig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseedstack%2Fcoffig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseedstack%2Fcoffig/lists"}