{"id":22532041,"url":"https://github.com/avionik-world/config-kit","last_synced_at":"2025-08-04T01:31:35.336Z","repository":{"id":228216188,"uuid":"773407156","full_name":"avionik-world/config-kit","owner":"avionik-world","description":"Create easy Config Files with json or yaml","archived":false,"fork":false,"pushed_at":"2024-03-20T18:20:15.000Z","size":75,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2024-03-20T19:53:03.665Z","etag":null,"topics":["config","json","jsonlib","yaml"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/avionik-world.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-03-17T15:26:20.000Z","updated_at":"2024-03-18T10:02:19.000Z","dependencies_parsed_at":"2024-03-19T17:52:56.743Z","dependency_job_id":null,"html_url":"https://github.com/avionik-world/config-kit","commit_stats":null,"previous_names":["avionik-world/config-kit"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avionik-world%2Fconfig-kit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avionik-world%2Fconfig-kit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avionik-world%2Fconfig-kit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avionik-world%2Fconfig-kit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/avionik-world","download_url":"https://codeload.github.com/avionik-world/config-kit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228576930,"owners_count":17939648,"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":["config","json","jsonlib","yaml"],"created_at":"2024-12-07T08:09:35.072Z","updated_at":"2024-12-07T08:09:35.658Z","avatar_url":"https://github.com/avionik-world.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ConfigKit\nWith this project you can easily create a config file.\n\n## Using ConfigKit in your plugin\n\n### Maven\n```xml\n\u003cdependencies\u003e\n \u003cdependency\u003e\n    \u003cgroupId\u003eworld.avionik\u003c/groupId\u003e\n    \u003cartifactId\u003econfig-kit\u003c/artifactId\u003e\n    \u003cversion\u003e1.0.1\u003c/version\u003e\n    \u003cscope\u003eprovided\u003c/scope\u003e\n  \u003c/dependency\u003e\n\u003c/dependencies\u003e\n```\n\n### Gradle\n```groovy\ndependencies {\n    compileOnly 'world.avionik:config-kit:1.0.1'\n}\n```\n\n## How to create a ConfigLoader\nFirst of all, you need to decide which format you want to use. We support Json and Yaml. Then you need a class that you save in the appropriate format. Then you have to think about which format you want to use. For example, let's take this config:\n```kotlin\nclass TestConfig(\n    val firstString: String,\n    val secondList: List\u003cString\u003e\n)\n```\n**Note:** If you want to save as a Yaml file, you have to write via the class `@Serialisable` to avoid errors.\n\n#### And this is how you can create the ConfigLoader\n```kotlin\nclass TestConfigLoader : ConfigLoader\u003cTestConfig\u003e(\n    File(\"config.json\"), // Here you can set where the file should be saved\n    JsonFileFormatter(TestConfig::class.java), // Here you have to adapt your format. There are JsonFileFormatter and YamlFileFormatter\n    { TestConfig(\"123\", listOf(\"abc\", \"def\")) }\n)\n```\n\n## How to use the ConfigLoader\nOnce you have successfully created a ConfigLoader, various methods are available to you. These include `configLoader.load()`, which is used to retrieve the configuration. \nIf you want to save a configuration, you can use the `configLoader.save(config)` method.\n\n## How to create the MultipleConfigLoader\nEverything remains the same as with the ConfigLoader, but with one exception. The class needs the nameable implantation so that the files can be selected.\n```kotlin\nclass KitConfig(\n    val name: String,\n    val secondList: List\u003cString\u003e\n) : Nameable {\n    override fun getName(): String = this.name\n}\n```\n**Note:** If you want to save as a Yaml file, you have to write via the class `@Serialisable` to avoid errors.\n\n#### And this is how you can create the MultipleConfigLoader\n```kotlin\nclass TestConfigLoader : MultipleConfigLoader\u003cKitConfig\u003e(\n    File(\"config/kits\"), // All files are saved in this directory\n    JsonFileFormatter(KitConfig::class.java) // Here you have to adapt your format. There are JsonFileFormatter and YamlFileFormatter\n)\n```\n\n## How to use the MultipleConfigLoader\nWith `configLoader.loadAll()` you can get all configs from this directory.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favionik-world%2Fconfig-kit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Favionik-world%2Fconfig-kit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favionik-world%2Fconfig-kit/lists"}