A flexible Kotlin library for seamless management and tracking of customizable application settings. Simplify the process of integrating user-configurable options into your projects.
Important
Kratos is specifically designed for Kotlin and works best when used with Kotlinβs coding style. Itβs strongly recommended to use it exclusively with Kotlin.
- Simple, customizable API: For creating and managing settings.
- Type-safe and easy integration: Designed to be type-safe and easy to integrate into Kotlin projects.
- Change tracking: Allows tracking changes to settings and performing side effects.
- Readable, maintainable structure: Blends naturally with Kotlin code.
Replace ${version} with the latest version of Kratos!
Gradle (Kotlin DSL)
repositories {
mavenCentral()
}
dependencies {
implementation("dev.lyzev.api", "kratos", "${version}")
}Gradle (Version Catalog)
[versions]
kratos = "${version}"
[libraries]
kratos = { module = "dev.lyzev.api:kratos", version.ref = "kratos" }Gradle (Groovy DSL)
repositories {
mavenCentral()
}
dependencies {
implementation 'dev.lyzev.api:kratos:${version}'
}Maven
<dependencies>
<dependency>
<groupId>dev.lyzev.api</groupId>
<artifactId>kratos</artifactId>
<version>${version}</version>
</dependency>
</dependencies>Raw Jar
- Visit the Maven Central Repository and download the JAR file for the version you need.
- Add the downloaded JAR to your project.
- You're all set!
Below is a simple example demonstrating how to implement a boolean setting and track its changes:
/**
* A specific implementation of the [Setting] class for boolean settings.
*
* @param container The class of the settings container where this setting belongs.
* @param name The name of the setting.
* @param value The initial value of the boolean setting.
* @param hide A lambda function that determines whether this setting is hidden or not.
* @param change A lambda function that will be called when the value of the setting changes.
*/
class BooleanSetting(
container: KClass<*>, name: String, value: Boolean, hide: () -> Boolean = { false }, change: (Boolean) -> Unit = {}
) : Setting<Boolean>(container, name, null, value, hide, change)
object Test {
var setting by BooleanSetting(Test::class, "Test", true) { println("Setting changed to $it") }
}
fun main() {
// Print the initial value of the setting.
println(Test.setting)
// Change the value of the setting to 'false'.
Test.setting = false
// Print the updated value of the setting.
println(Test.setting)
}In this example:
- We define a
BooleanSettingthat extendsSetting<Boolean>. - We create a
Testobject with a mutable property powered byBooleanSetting. - Changing the property triggers a callback, which can be logged or used to update your UI.
Tip
The library is quite intuitive, so it's a good idea to try it out. You'll quickly learn its capabilities.
Warning
This documentation is automatically generated by Dokka.
For documentation, check out the Kratos Documentation.
For bugs or suggestions, please submit them via the GitHub Issue Tracker. Kindly use the provided templates and include all relevant details to ensure we can resolve your issue quickly. Your cooperation is greatly appreciated!
Need help with minor concerns or have questions? Join our supportive community on the Discord server. Our friendly members and staff are here to assist you!
We welcome contributions from the community! Please read our Contribution Guidelines to get started.
Please review our Security Policy to understand how we handle security vulnerabilities.
Caution
Please do not publicly disclose the vulnerability until it has been fixed.
Copyright (C) 2025 Lyzev
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/agpl-3.0.en.html.
Kratos is developed and maintained by Schizoid Development. Thank you for using Kratos!