Thanks to visit codestin.com
Credit goes to github.com

Skip to content

A flexible Kotlin library for seamless management and tracking of customizable application settings. Simplify the process of integrating user-configurable options into your projects.

License

Notifications You must be signed in to change notification settings

SchizoidDevelopment/kratos

Kratos: Setting Management for Kotlin

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.

πŸ—οΈ Key Features

  • 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.

πŸ“¦ Installation

Maven Central

Maven Central Version

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
  1. Visit the Maven Central Repository and download the JAR file for the version you need.
  2. Add the downloaded JAR to your project.
  3. You're all set!

πŸ’‘ Usage

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:

  1. We define a BooleanSetting that extends Setting<Boolean>.
  2. We create a Test object with a mutable property powered by BooleanSetting.
  3. 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.

πŸ“š Documentation

Warning

This documentation is automatically generated by Dokka.

For documentation, check out the Kratos Documentation.

Documentation

🐞 Bugs and Suggestions

GitHub Issues πŸ›

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!

GitHub Issues

Discord Community πŸ’¬

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!

Discord Server

🀝 Contribution Guidelines

We welcome contributions from the community! Please read our Contribution Guidelines to get started.

Pull Requests

πŸ”’ Security Policy

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.

πŸ“„ License

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!

About

A flexible Kotlin library for seamless management and tracking of customizable application settings. Simplify the process of integrating user-configurable options into your projects.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Contributors 2

  •  
  •  

Languages