CarmJos / EasyOptions

:black_nib: Easy (to define) Options! A lightweight, easy-to-use option definition library in Java, useful for runtime library developers.

Home Page:https://carmjos.github.io/EasyOptions/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

 ___               ___       _   _             
| __|__ _ ____  _ / _ \ _ __| |_(_)___ _ _  ___
| _|/ _` (_-< || | (_) | '_ \  _| / _ \ ' \(_-<
|___\__,_/__/\_, |\___/| .__/\__|_\___/_||_/__/
             |__/      |_|                     

README LANGUAGES [ English | 中文 ]

EasyOptions

version License workflow CodeFactor CodeSize

Easy (to define) Options!

A lightweight, easy-to-use option definition library in Java, useful for runtime library developers.

Development

For the latest JavaDoc release, CLICK HERE.

Code Samples

public interface DemoOptions {

    /**
     * Option descriptions
     */
    OptionType<String> SEPARATOR = OptionType.of(":-:");

}
public class Sample {
  public static void main(String[] args) {
      OptionHolder holder = new OptionHolder(); // Create holder

      holder.set(DemoOptions.SEPARATOR, ":-)"); // Set value
      
      String separator = holder.get(DemoOptions.SEPARATOR); // Get value

      // Set value to default
      String previous = holder.set(DemoOptions.SEPARATOR, null);
  }
}

Dependencies

Maven Dependency

Remote Repository Configuration
<project>
    <repositories>

        <repository>
            <!-- Using Maven Central Repository for secure and stable updates, though synchronization might be needed. -->
            <id>maven</id>
            <name>Maven Central</name>
            <url>https://repo1.maven.org/maven2</url>
        </repository>

        <repository>
            <!-- Using GitHub dependencies for real-time updates, configure required (recommended). -->
            <id>github</id>
            <name>GitHub Packages</name>
            <url>https://maven.pkg.github.com/CarmJos/EasyOptions</url>
        </repository>

    </repositories>
</project>
Generic Native Dependency
<project>
    <dependencies>
        <dependency>
            <groupId>cc.carm.lib</groupId>
            <artifactId>easyoptions</artifactId>
            <version>[LATEST RELEASE]</version>
            <scope>compile</scope>
        </dependency>
    </dependencies>
</project>

Gradle Dependency

Remote Repository Configuration
repositories {

    // Using Maven Central Repository for secure and stable updates, though synchronization might be needed.
    mavenCentral()

    // Using GitHub dependencies for real-time updates, configure required (recommended).
    maven { url 'https://maven.pkg.github.com/CarmJos/EasyOptions' }

}
Generic Native Dependency
dependencies {
    api "cc.carm.lib:easyoptions:[LATEST RELEASE]"
}

Support and Donation

If you appreciate this plugin, consider supporting me with a donation!

Thank you for supporting open-source projects!

Many thanks to Jetbrains for kindly providing a license for us to work on this and other open-source projects.

Open Source License

This project's source code is licensed under The MIT License.

About

:black_nib: Easy (to define) Options! A lightweight, easy-to-use option definition library in Java, useful for runtime library developers.

https://carmjos.github.io/EasyOptions/

License:MIT License


Languages

Language:Java 100.0%