Simple
No more code to load, convert and manage properties files — just use your properties in the simplest possible way.
Questa pagina non è ancora tradotta in italiano: quello che segue è il testo inglese.
Put your settings in a properties file, exactly as you already do:
port=80hostname=foobar.commaxThreads=100Declare an interface next to it, and let OWNER do the wiring:
import org.aeonbits.owner.Config;
public interface ServerConfig extends Config { int port(); String hostname();
@DefaultValue("42") int maxThreads();}Then read your configuration as typed values, with no loading code at all:
ServerConfig cfg = ConfigFactory.create(ServerConfig.class);System.out.println("Running on " + cfg.hostname() + ":" + cfg.port());That is the whole thing. No Properties object to load, no getProperty() call
to spell out, no string to parse into an int.
Simple
No more code to load, convert and manage properties files — just use your properties in the simplest possible way.
Powerful
Annotation based, automatic type conversion, variables expansion, loading strategies, hot reload, event notifications, and much more.
Flexible
Pick the features you need and forget the ones you don’t. Easy to adopt, scales with complexity, fully documented.