{"id":15285928,"url":"https://github.com/dejvokep/boosted-yaml","last_synced_at":"2025-04-05T01:06:32.770Z","repository":{"id":40289432,"uuid":"355878351","full_name":"dejvokep/boosted-yaml","owner":"dejvokep","description":"A simple-to-use standalone Java library delivering boosted experience while working with YAML documents.","archived":false,"fork":false,"pushed_at":"2025-02-24T15:55:50.000Z","size":945,"stargazers_count":97,"open_issues_count":1,"forks_count":9,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-03-29T00:09:08.859Z","etag":null,"topics":["automation","bukkit","file","functional-programming","java","spigot","standalone","yaml"],"latest_commit_sha":null,"homepage":"https://dejvokep.gitbook.io/boostedyaml/","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/dejvokep.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":"2021-04-08T11:24:14.000Z","updated_at":"2025-03-12T00:03:55.000Z","dependencies_parsed_at":"2024-05-02T20:34:28.836Z","dependency_job_id":"c11e01c1-2318-4b69-bdde-30c3882bf6c0","html_url":"https://github.com/dejvokep/boosted-yaml","commit_stats":{"total_commits":273,"total_committers":9,"mean_commits":"30.333333333333332","dds":0.1282051282051282,"last_synced_commit":"16187bb5de07c48735cfd23816bc7ca5bb76955e"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dejvokep%2Fboosted-yaml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dejvokep%2Fboosted-yaml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dejvokep%2Fboosted-yaml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dejvokep%2Fboosted-yaml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dejvokep","download_url":"https://codeload.github.com/dejvokep/boosted-yaml/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247271529,"owners_count":20911587,"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":["automation","bukkit","file","functional-programming","java","spigot","standalone","yaml"],"created_at":"2024-09-30T15:08:35.475Z","updated_at":"2025-04-05T01:06:32.752Z","avatar_url":"https://github.com/dejvokep.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🔼 BoostedYAML\n\nA simple-to-use standalone (beneficial for cross-platform and multimodule projects) Java library delivering boosted experience while working with YAML documents. Work on this\nproject started on Apr 8, 2021 with the target to build advanced, hence still easy-to-use library which would enable\ndevelopers to manage documents and files with ease.\n\nIf you are developing plugins for Spigot/BungeeCord API, make sure to read the post at [SpigotMC forums](https://www.spigotmc.org/threads/545585/) for more information regarding setup and other relevant useful information.\n\n# ❓ Why to use BoostedYAML over other libraries?\n\nBoostedYAML is single of its kind, given the following advantages:\n\n1. **SnakeYAML Engine based** - built upon popular and trusted software.\n2. **YAML 1.2 supported** - allows to reliably parse JSON files\n3. **Comments everywhere** - no longer a headache for your customers, say bye to external documentation.\n4. **File updater** - upgrading to the latest version of your software? Adapt the configuration files easily, with one\n   line of code.\n5. **Beautiful structure management** - makes your code cleaner and easier to read.\n6. **Functional interfaces included** - we've got something for everyone.\n7. **Amazing features** - automatic saving, updating, endless possibilities.\n8. **Settings for everything** - customize it to suite your needs just perfectly.\n9. **Performant and well documented** - just like a dream.\n10. **Open source** - if there's anything that can be improved, feel free to let me know, or contribute.\n11. **TDD (test driven development)** - don't worry about reliability, everything's verified automatically before\n    production by more than 140 tests.\n\nAll of that with quick and kind support. Convinced? Let's get you onboard.\n\n# 🔧 Quick setup\nSetup takes only about 5 minutes. Example software built using this guide is available at https://github.com/dejvokep/boosted-yaml-example.\n## 1.1. Add using Maven:\nBoostedYAML is hosted by Maven Central Repository. That means, you only need to add a dependency:\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003edev.dejvokep\u003c/groupId\u003e\n  \u003cartifactId\u003eboosted-yaml\u003c/artifactId\u003e\n  \u003cversion\u003e1.3.6\u003c/version\u003e\n\u003c/dependency\u003e\n```\nAdd the following shading section to prevent class loader conflicts:\n```xml\n\u003cbuild\u003e\n  \u003cplugins\u003e\n    \u003cplugin\u003e\n      \u003cgroupId\u003eorg.apache.maven.plugins\u003c/groupId\u003e\n      \u003cartifactId\u003emaven-shade-plugin\u003c/artifactId\u003e\n      \u003cversion\u003e3.3.0\u003c/version\u003e\n      \u003cconfiguration\u003e\n        \u003crelocations\u003e\n          \u003crelocation\u003e\n            \u003cpattern\u003edev.dejvokep.boostedyaml\u003c/pattern\u003e\n            \u003c!-- Replace this --\u003e\n            \u003cshadedPattern\u003eme.plugin.libs\u003c/shadedPattern\u003e\n          \u003c/relocation\u003e\n        \u003c/relocations\u003e\n      \u003c/configuration\u003e\n      \u003cexecutions\u003e\n        \u003cexecution\u003e\n          \u003cphase\u003epackage\u003c/phase\u003e\n          \u003cgoals\u003e\n            \u003cgoal\u003eshade\u003c/goal\u003e\n          \u003c/goals\u003e\n        \u003c/execution\u003e\n      \u003c/executions\u003e\n    \u003c/plugin\u003e\n  \u003c/plugins\u003e\n\u003c/build\u003e\n```\n## 1.2. Add using Gradle:\nBoostedYAML is hosted by Maven Central Repository. That means, you only need to add a dependency (and the maven central repo):\n```gradle\nrepositories {\n   mavenCentral()\n}\n\ndependencies {\n   implementation \"dev.dejvokep:boosted-yaml:1.3.6\"\n}\n```\n\nAdd the following shadowing section to prevent class loader conflicts:\n- Add this at the very start of your build.gradle file: (Gradle 7.3)\n- Get your desired version from [here](https://github.com/GradleUp/shadow)\n```gradle\nplugins {\n  id 'com.gradleup.shadow' version '8.3.5'\n  id 'java'\n}\n```\n- To use the shadowing project, this will help with relocating,\n- if this is not available for your gradle version, please [take a look here](https://imperceptiblethoughts.com/shadow/getting-started/)\n\nThen at the end of your build.gradle file:\n```gradle\n// Relocating a Package\nshadowJar {\n   // The second string is where you will locate dev.dejvokep.boostedyaml\n   relocate 'dev.dejvokep.boostedyaml', 'me.plugin.libs'\n}\n```\nLearn more about shadow for gradle [here](https://imperceptiblethoughts.com/shadow/introduction/#benefits-of-shadow)\n\n## 2. Routes and how to access content\nRoutes are immutable objects used to address content - similar to URIs (Universe Resource Identifier). Please read more about them [here](https://dejvokep.gitbook.io/boostedyaml/routing/routes).\n## 3. Create your document:\nPlease note that this guide covers only the basics, there are a lot more variations of the method - learn more at the [Javadoc](https://javadoc.io/doc/dev.dejvokep/boosted-yaml/latest/dev/dejvokep/boostedyaml/YamlDocument.html) or [wiki](https://dejvokep.gitbook.io/boostedyaml/).\n```java\nYamlDocument config = YamlDocument.create(new File(\"config.yml\"), getResource(\"config.yml\"));\n```\n**The file will automatically be managed by the library** - no need to create it if it does not exist, nor copy the defaults. Everything's done automatically. **Please note** that if you chose to use [Routes (objects)](https://javadoc.io/doc/dev.dejvokep/boosted-yaml/latest/dev/dejvokep/boostedyaml/route/Route.html), you will need to configure the document to use `KeyFormat.OBJECT`. You can do so via GeneralSettings, with the final `.create()` method looking like:\n```java\nYamlDocument config = YamlDocument.create(new File(\"config.yml\"), getResource(\"config.yml\"), GeneralSettings.builder().setKeyFormat(KeyFormat.OBJECT).build(), LoaderSettings.DEFAULT, DumperSettings.DEFAULT, UpdaterSettings.DEFAULT);\n```\n## 4. Updater prerequisites:\n###### A)\nYou might already be familiar with specifying version inside your document, most common is something like this:\n```yaml\nconfig-version: 1\n```\nBoostedYAML defines such information as version ID. Pick a route at which the version ID of the document will be. **You will never be able to change it** and **the defaults must have it specified and valid**. Provide the route to UpdaterSettings like this:\n```java\nUpdaterSettings.builder().setVersioning(new BasicVersioning(\"config-version\")).build();\n```\nDo not forget to provide the built settings to the `.create()` method.\n###### B)\nThe first version ID the document's going to have is 1, like shown below. The next release of the file will have ID of 2, then 3...:\n```yaml\nconfig-version: 1   # 1st release\nconfig-version: 2   # 2nd release\nconfig-version: 3   # 3rd release\n# etc.\n```\n###### C)\nParameters of the `.create()` might now look like this:\n```java\nYamlDocument config = YamlDocument.create(new File(\"config.yml\"), getResource(\"config.yml\"), GeneralSettings.DEFAULT, LoaderSettings.builder().setAutoUpdate(true).build(), DumperSettings.DEFAULT, UpdaterSettings.builder().setVersioning(new BasicVersioning(\"config-version\")).build());\n```\nThe custom LoaderSettings with enabled auto-update will ensure the document's automatically updated initially and each time it's reloaded.\n\n**That's it! No need to do some weird file version handling manually, let BoostedYAML do it for you.** The updater also offers some nice features like [ignored routes](https://dejvokep.gitbook.io/boostedyaml/settings/updatersettings#ignored-routes) and [relocations](https://dejvokep.gitbook.io/boostedyaml/settings/updatersettings#ignored-routes), which you can learn more about by clicking the links.\n## 5. Use the document to it's fullest:\nReload/save anytime from/to the file:\n```java\nconfig.reload();\nconfig.save();\n```\nObtain data using `getX(String route)`, alternatively, use functional getters for functional method chaining:\n```java\nMode m = config.getStringOptional(\"mode\").map(mode -\u003e Mode.valueOf(mode.toUpperCase())).orElse(Mode.PERFORMANCE);\n```\n**BoostedYAML also provides** its own serialization system and other cool options, about which you can read more [at the wiki](https://dejvokep.gitbook.io/boostedyaml/).\n\n# 🤖 Support\nYou can read the detailed instructions [at the wiki](https://dejvokep.gitbook.io/boostedyaml/). If you need help with anything, feel free join the [Discord server](https://discord.gg/BbhADEy). Or, just to talk with us 👋\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdejvokep%2Fboosted-yaml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdejvokep%2Fboosted-yaml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdejvokep%2Fboosted-yaml/lists"}