A library that makes configuration in Java applications easy
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.externalToolBuilders
src
.classpath
.gitignore
.project
COPYING
COPYING.LESSER
README.md
build.xml

README.md

CIT Configuration (v. 0.0.1)

CIT Configuration is a library that makes configuration in Java applications easy.

It's part of the Common Infrastructure Tools (CIT) project hosted by Macroing.org.

Supported Features

  • A thread-safe API for storing and retrieving configuration values.
  • Uses Optional and friends when retrieving configuration values.
  • Supports observing changes made to a Configuration instance.

Examples

import org.macroing.cit.configuration.Configuration;
import org.macroing.cit.java.util.OptionalBoolean;

public class MyConfiguration {
    public static void main(String[] args) {
//      Create the Configuration:
        Configuration configuration = new Configuration();
        configuration.addConfigurationObserver((configuration0, id, oldObject, newObject) -> System.out.println(newObject));
        configuration.setObject("A", true);
        
//      Get the OptionalBooleans:
        OptionalBoolean a = configuration.getBoolean("A");
        OptionalBoolean b = configuration.getBoolean("B", false);
    }
}

Dependencies

Note

This library has not been properly released yet. This means, even though it says it's version 1.0.0 in the build.xml file and all Java source code files, it should not be treated as such. When this library gets released, it will be tagged and available on the "releases" page.