Configs Module


Configs are a useful extension for properties file. Main features:

  • using a set of standard converters
  • specifying default value for property
  • saving all properties that were used into file

You can add Boot module to your project by inserting dependency in pom.xml:



Note: To run the example, you need to clone DataKernel from GitHub:
$ git clone
And import it as a Maven project. Before running the example, build the project.

An example of providing configs to your application:

public final class ConfigModuleExample {
	private static final String PROPERTIES_FILE = "";

	public static void main(String[] args) {
		Injector injector = Injector.of(Module.create()
				.bind(Config.class).to(() -> Config.ofClassPathProperties(PROPERTIES_FILE))
				.bind(String.class).to(c -> c.get("phrase"), Config.class)
				.bind(Integer.class).to(c -> c.get(ofInteger(), "number"), Config.class)
				.bind(InetAddress.class).to(c -> c.get(ofInetAddress(), "address"), Config.class));